| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 
 | npm install postcss-px-to-viewport --save-dev
 //个人不常用
 //修改 postcss.config.js
 
 module.exports = {
 plugins: {
 autoprefixer: {},
 "postcss-px-to-viewport": {
 viewportWidth: 375,  //视窗宽度
 viewportHeight: 667,  //视窗高度
 unitPrecision: 5,  //指定`px`转换为视窗单位值的小数位数
 viewportUnit: 'vw',  //指定需要转成的视窗单位,建议vw
 // selectorBlackLict: ['',''],  //指定不需要转换的类   出问题!!!
 exclude: [/正则/], 正则匹配的不做转换  出问题!!!
 minPixelCalue: 1,  //小于1px不转换
 mediaQuery: false  //允许在媒体查询中转换`px`
 }
 }
 }
 
 |