@quarkd/rollup-plugin-css-variable
v1.0.0
Published
css变量替换插件
Downloads
12
Readme
quark-rollup-plugin-css-variable
一个能够支持替换css中符合规则的变量的rollup插件。
Usage
rollup.config.js
import cssVariable from '@quarkd/rollup-plugin-css-variable';
const variableMap = {
textColorWhite: '#ffffff',
}
export default {
input: 'index.js',
output: { file: 'dist/index.js', format: 'esm'},
plugins: [
// 建议放在第一位
cssVariable({
variableMap,
prefix: 'quark-'
})
]
};
style.css - input
.text-white {
color: quark-textColorWhite;
}
style.css - output
.text-white {
color: #ffffff;
}