PostCSS plugin for use with flextype that converts --flextype declarations into hidden ::before pseudo-content to work with browsers that don't yet support CSS variables.
.foo {
--flextype: 5%;
}
.bar {
--flextype: '{"100": 12, "500+": 18}';
}.foo::before {
content: '5%';
display: none;
}
.bar::before {
content: '{"100": 12, "500+": 18}';
display: none;
}npm install postcss-flextype --saveconst postcss = require('postcss');
const flextype = require('postcss-flextype');
postcss([flextype]);If set to false postcss-flextype will leave the --flextype declarations in your CSS in addition to adding them as ::before content.