1.1.1 • Published 6 years ago
postcss-plugin-extract-theme v1.1.1
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-devUsage
config postcss.config.js
// postcss.config.js
module.export = {
plugins: {
'postcss-plugin-extract-theme': {
rulesMap: {
'#fff': '#000',
},
themeNames: ['light', 'dark'],
output() {
// something
}
}
}
}