react lib-flexible适配
1,npm i lib-flexible postcss-pxtorem -D
2,index.js
import 'lib-flexible'
3webpack.config
const px2rem = require('postcss-pxtorem')
px2rem({
rootValue: 37.5, // 基数192
unitPrecision: 5, // 进制位数
propList: ['*'] // 所有属性 都匹配rem
}),
位置
],
px2rem({
rootValue: 37.5, // 基数192
unitPrecision: 5, // 进制位数
propList: ['*'] // 所有属性 都匹配rem
}),
// Adds PostCSS Normalize as the reset css with default options,
// so that it honors browserslist config in package.json
// which in turn let's users customize the target behavior as per their needs.
'postcss-normalize',
]
本文来自博客园,作者:zjxgdq,转载请注明原文链接:https://www.cnblogs.com/zjxzhj/p/16144301.html

浙公网安备 33010602011771号