epiphany/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values
2023-12-09 22:48:07 -08:00
..
dist stylelint/eleventy config 2023-12-09 22:48:07 -08:00
CHANGELOG.md stylelint/eleventy config 2023-12-09 22:48:07 -08:00
LICENSE.md stylelint/eleventy config 2023-12-09 22:48:07 -08:00
package.json stylelint/eleventy config 2023-12-09 22:48:07 -08:00
README.md stylelint/eleventy config 2023-12-09 22:48:07 -08:00

PostCSS Media Queries Aspect-Ratio Number Values PostCSS Logo

npm version CSS Standard Status Build Status Discord

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 */);

PostCSS Media Queries Aspect-Ratio Number Values runs in all Node environments, with special instructions for:

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) {}