postcss-ui-theme
let you can easy change ui theme by postcss.
- 自定义导入文件配置
- 支持 bem 命名
- 支持类 sass 语法
- 支持打包 css4 变量
- 支持配置静态文件路径
Add postcss-ui-theme to your build tool:
npm install postcss-ui-theme --save-dev
Use postcss-ui-theme to process your CSS:
import postcssUiTheme from 'postcss-ui-theme';
postcssUiTheme.process(YOUR_CSS);
Add PostCSS to your build tool:
npm install postcss --save-dev
import postcss from 'postcss';
import postcssUI from 'postcss-ui-theme';
postcss([
postcssUI(/* options */)
]).process(YOUR_CSS);
module.exports = {
plugins: [require('postcss-ui-theme')]
}
The postcss-import configs
import : {
postcssImportOptions
}
默认配置
customProperties: {
preserve: true,
warnings: false
}
the postcss-custom-properties configs
默认配置
assets: {
basePath: './',
relative: true
}
the postcss-assets configs
有关 bem 参考saladcss-bem configs。
默认配置
defaultNamespace: undefined, // means no prefix
separators: {
descendent: '__'
},
shortcuts: {
modifier: 'm',
descendent: 'd',
component: 'c'
}
有关 autoprefixer 参考 autoprefixer configs
默认配置
overrideBrowserslist: ['ie > 8', 'last 2 versions']
postcss-ui-theme is powered by the following plugins (in this order):