@csstools/postcss-media-queries-aspect-ratio-number-values
v3.0.4
Published
Use number values in aspect-ratio media queries.
Downloads
5,214,223
Readme
PostCSS Media Queries Aspect-Ratio Number Values
npm install @csstools/postcss-media-queries-aspect-ratio-number-values --save-dev
PostCSS Media Queries Aspect-Ratio Number Values lets you use non-integer numbers and calc()
in aspect-ratio
feature queries following the Media Queries 4 Specification.
@media (min-aspect-ratio: 1.77) {}
/* becomes */
@media (min-aspect-ratio: 177/100) {}
Usage
Add PostCSS Media Queries Aspect-Ratio Number Values to your project:
npm install postcss @csstools/postcss-media-queries-aspect-ratio-number-values --save-dev
Use it as a PostCSS plugin:
const postcss = require('postcss');
const postcssMediaQueriesAspectRatioNumberValues = require('@csstools/postcss-media-queries-aspect-ratio-number-values');
postcss([
postcssMediaQueriesAspectRatioNumberValues(/* pluginOptions */)
]).process(YOUR_CSS /*, processOptions */);
Options
preserve
The preserve
option determines whether the original notation
is preserved. By default, it is not preserved.
postcssMediaQueriesAspectRatioNumberValues({ preserve: true })
@media (min-aspect-ratio: 1.77) {}
/* becomes */
@media (min-aspect-ratio: 1.77),(min-aspect-ratio: 177/100) {}