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',
                ]

  

posted @ 2022-04-14 14:14  zjxgdq  阅读(127)  评论(0编辑  收藏  举报