Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@aofl/picture
Advanced tools
`` serves as a container for zero or more `` and one `` elements to provide versions of an image for different display sizes. Display size specific sources are defined using the media attribute of the `aofl-source` ele
<aofl-picture>
serves as a container for zero or more <aofl-source>
and one <aofl-img>
elements to provide versions of an image for different display sizes. Display size specific sources are defined using the media attribute of the aofl-source
element.
npm i -S @aofl/picture
<aofl-picture>
<aofl-source media="(max-width: 320px)" srcset="https://via.placeholder.com/300x150" width="300" height="150"></aofl-source>
<aofl-source media="(max-width: 500px)" srcset="https://via.placeholder.com/500x250" width="500" height="250"></aofl-source>
<aofl-source media="(max-width: 700px)" srcset="https://via.placeholder.com/700x350" width="700" height="350"></aofl-source>
<aofl-img src="https://via.placeholder.com/1000x500" width="1000" height="500"></aofl-img>
</aofl-picture>
Attributes | Type | Default | Description |
---|---|---|---|
disable-sources | Boolean | false | disable-sources can be used to deactivate the media query checks when aofl-picture loads. It is useful for cases where the desktop version of the app is not responsive. |
<aofl-img>
embeds an image into the document. It behaves similarly to <img>
with the addition of lazy loading images as they scroll near the visible area of the screen. The current formula is 2x height or width. In addition to this <aofl-img>
can be combined with <aofl-picture>
and <aofl-source>
to provide different images for different display sizes.
<aofl-img src="path/to/image" width="100" height="100" alt="image description"></aofl-img>
Attributes | Type | Default | Description |
---|---|---|---|
src | String | undefined | Image url |
width | Number | undefined | Width of image in pixels. |
Height | Number | undefined | Height of image in pixels. |
alt | String | undefined | Defines an alternative text description of the image. |
AoflSource component must be used as a child of aofl-picture and specifies images for different media queries.
<aofl-picture>
<aofl-source media="(max-width: 480px)" srcset="path/to/image-480"></aofl-source>
<aofl-source media="(max-width: 640px)" srcset="path/to/image-640"></aofl-source>
<aofl-source media="(max-width: 1024px)" srcset="path/to/image-1024"></aofl-source>
<aofl-img src="path/to/image" width="" height=""></aofl-img>
</aofl-picture>
Attributes | Type | Default | Description |
---|---|---|---|
media | String | media query specifying when aofl-source becomes active. | |
srcset | String | Url of the image. |
FAQs
`` serves as a container for zero or more `` and one `` elements to provide versions of an image for different display sizes. Display size specific sources are defined using the media attribute of the `aofl-source` ele
The npm package @aofl/picture receives a total of 0 weekly downloads. As such, @aofl/picture popularity was classified as not popular.
We found that @aofl/picture demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.