A PostCSS plugin to fix an element's dimensions to an aspect ratio.
There is already a standard aspect-ratio in the CSS specification, and Chrome has experimental support. So it is recommended to use /
to separate values, the next version may deprecate :
separator.
Install
npm i postcss-aspect-ratio-mini --save
Usage
var postcss = var output = css
Example
A simple example using the custom ratio value 16 / 9
.
Input
Output
Test
npm test