标签:允许 字符串 stc round dia query media .config cut
依赖包:
配置:
在项目根目录下创建 postcss.config.js
配置如下:
module.exports = () => ({
plugins: [
require(‘autoprefixer‘)(),
// require(‘postcss-px2rem‘)({ remUnit: 75 })
require(‘postcss-pxtorem‘)({
rootValue: 37.5,
propList: [‘*‘]
})
]
});
rootValue (Number)根元素字体大小。unitPrecision (数字)允许REM单位增长的十进制数。propList (数组)可以从px更改为rem的属性。
*启用所有属性。例:[‘*‘]*在单词的开头或结尾使用。([‘*position*‘]会匹配background-position-y)!与属性不匹配。例:[‘*‘, ‘!letter-spacing‘][‘*‘, ‘!font*‘]selectorBlackList (数组)要忽略的选择器并保留为px。
[‘body‘] 会匹配 .body-class[/^body$/]会匹配body但不会.bodyreplace (布尔值)替换包含rems的规则,而不是添加回退。mediaQuery (布尔值)允许在媒体查询中转换px。minPixelValue (数字)设置要替换的最小像素值。@vue/cl构建得项目下,postcss.config.js配置,将px转化成rem
标签:允许 字符串 stc round dia query media .config cut
原文地址:https://www.cnblogs.com/zhangycun/p/10762762.html