postcss-custom-properties
A PostCSS plugin to polyfill the
W3C-style CSS Custom Properties for cascading variables.
N.B. For now the polyfill is not complete. It currently just aims to provide a future-proof way of using a limited subset of the features provided by native CSS variables.
Checkout opened issue to know the state of this plugin.
Installation
npm install postcss-custom-properties
Usage
var fs = require('fs')
var postcss = require('postcss')
var customProperties = require('postcss-custom-properties')
var css = fs.readFileSync('build/build.css', 'utf8')
var out = postcss(customProperties()).process(css).css
Options
preserve
(default: false
)
Allow you to preserve custom properties & var() usage in output.
var out = postcss(customProperties({preserve: true})).process(css).css