$ gnpm install @csstools/postcss-media-queries-aspect-ratio-number-values
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) {}
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 */);
PostCSS Media Queries Aspect-Ratio Number Values runs in all Node environments, with special instructions for:
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) {}
Copyright 2013 - present © cnpmjs.org | Home |