Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@polymer/iron-image
Advanced tools
An image-displaying element with lots of convenient features
iron-image
is an element for displaying an image that provides useful sizing and
preloading options not found on the standard <img>
tag.
The sizing
option allows the image to be either cropped (cover
) or
letterboxed (contain
) to fill a fixed user-size placed on the element.
The preload
option prevents the browser from rendering the image until the
image is fully loaded. In the interim, either the element's CSS background-color
can be be used as the placeholder, or the placeholder
property can be
set to a URL (preferably a data-URI, for instant rendering) for an
placeholder image.
The fade
option (only valid when preload
is set) will cause the placeholder
image/color to be faded out once the image is rendered.
Examples:
Basically identical to <img src="...">
tag:
<iron-image src="http://lorempixel.com/400/400"></iron-image>
Will letterbox the image to fit:
<iron-image style="width:400px; height:400px;" sizing="contain"
src="http://lorempixel.com/600/400"></iron-image>
Will crop the image to fit:
<iron-image style="width:400px; height:400px;" sizing="cover"
src="http://lorempixel.com/600/400"></iron-image>
Will show light-gray background until the image loads:
<iron-image style="width:400px; height:400px; background-color: lightgray;"
sizing="cover" preload src="http://lorempixel.com/600/400"></iron-image>
Will show a base-64 encoded placeholder image until the image loads:
<iron-image style="width:400px; height:400px;" placeholder="data:image/gif;base64,..."
sizing="cover" preload src="http://lorempixel.com/600/400"></iron-image>
Will fade the light-gray background out once the image is loaded:
<iron-image style="width:400px; height:400px; background-color: lightgray;"
sizing="cover" preload fade src="http://lorempixel.com/600/400"></iron-image>
Custom property | Description | Default |
---|---|---|
--iron-image-placeholder | Mixin applied to #placeholder | {} |
--iron-image-width | Sets the width of the wrapped image | auto |
--iron-image-height | Sets the height of the wrapped image | auto |
FAQs
An image-displaying element with lots of convenient features
The npm package @polymer/iron-image receives a total of 7,666 weekly downloads. As such, @polymer/iron-image popularity was classified as popular.
We found that @polymer/iron-image demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 12 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.