@silvermine/postcss-css-var-fallback
v1.0.0-rc.1
Published
PostCSS plugin to insert fallbacks for CSS vars
Downloads
7
Readme
PostCSS CSS Var Fallback
PostCSS plugin to insert fallbacks for CSS vars.
.foo {
/* Input example */
color: var(--color, #4a6da7);
}
.foo {
/* Output example */
color: #4a6da7;
color: var(--color, #4a6da7);
}
Usage
Step 1: Install plugin:
npm install --save-dev postcss @silvermine/postcss-css-var-fallback
Step 2: Check you project for existed PostCSS config: postcss.config.js
in the project root, "postcss"
section in package.json
or postcss
in bundle config.
If you do not use PostCSS, add it according to official docs and set this plugin in settings.
Step 3: Add the plugin to plugins list:
module.exports = {
plugins: [
+ require('@silvermine/postcss-css-var-fallback'),
require('autoprefixer')
]
}