1.0.0-rc.1 • Published 4 years ago

@silvermine/postcss-css-var-fallback v1.0.0-rc.1

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

PostCSS CSS Var Fallback

NPM Version License Build Status Coverage Status Dependency Status Dev Dependency Status Conventional Commits

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')
  ]
}
1.0.0-rc.1

4 years ago

1.0.0-rc.0

4 years ago