
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
postcss-image-sizes
Advanced tools
PostCSS plugin for printing image sizes in your css. It includes helpers for both retina and non-retina images.
img.my_image {
/* Input example */
background-size: image-width('~my_image.png') image-height('~my_image.png');
}
img.my_hidpi_image {
/* Input example */
background-size: hidpi-image-width('~my_image.png') hidpi-image-height('~my_image.png');
}
img.my_image {
/* Output example */
background-size: 100px 200px;
}
img.my_hidpi_image {
/* Output example */
background-size: 50px 100px;
}
const imageSizes = require('postcss-image-sizes')
postcss([imageSizes({assetsPath: '/path/to/images'})])
See PostCSS docs for examples for your environment.
We recommend to use absolute paths for images, since CSS has very limited support for relative paths. Path is treated as absolute, when it is prefixed with ~
or /
sign. You need to specify assetsPath
option to use those absolute paths (see below).
All other paths will be treated as relative (to current file).
assetsPath
— absolute path, against which images paths will be resolved.
FAQs
PostCSS plugin to automatically get image dimensions
The npm package postcss-image-sizes receives a total of 66 weekly downloads. As such, postcss-image-sizes popularity was classified as not popular.
We found that postcss-image-sizes 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
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.