PostCSS rem func 
PostCSS plugin to use calculate rem values.
Example
Input
.demo {
font-size: rem(24);
padding: rem(5, 10);
}
Output
.demo {
font-size: 1.5rem;
padding: 0.5rem;
}
Options
With baseline
to 10
:
.demo {
font-size: 2.4rem;
padding: 0.5rem;
}
Usage
Install with npm i postcss-rem-func
and use with PostCSS:
postcss([require("postcss-rem-func")]);
Example with custom options:
postcss([
require("postcss-rem-func")({
baseline: 10,
precision: 6,
}),
]);
See PostCSS docs for examples for your environment.