@silvermine/postcss-css-var-fallback

1.0.0-rc.1 • Public • Published

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')
  ]
}

Package Sidebar

Install

npm i @silvermine/postcss-css-var-fallback

Weekly Downloads

5

Version

1.0.0-rc.1

License

MIT

Unpacked Size

6.82 kB

Total Files

9

Last publish

Collaborators

  • onebytegone
  • webpub
  • jthomerson