1.1.1 • Published 4 years ago

postcss-plugin-extract-theme v1.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

postcss-plugin-extract-theme


extract target color and extract target color for genrate theme.

Example

.test {
  color: #fff;
}

will be transform to light theme and dark theme :

.test {
}
.light .test {
  color: #fff;
}
.light .test {
  color: #000;
}

Installation

npm install postcss-plugin-extract-theme --save-dev

Usage

config postcss.config.js

// postcss.config.js
module.export = {
  plugins: {
     'postcss-plugin-extract-theme': {
        rulesMap: {
          '#fff': '#000',
        },
        themeNames: ['light', 'dark'],
        output() {
          // something
        }
     }
  } 
}