Reference issues: https://github.com/NervJS/taro-ui/issues/1069#issuecomment-661600488

Install “postcss-px-scale”. Install “postcss-px-scale”.

npm i postcss-px-scale --save-dev

Config /index.js Set DesignWidth, DeviceRatio

DesignWidth: 375, Deviceratio: {640:2.34/2, 750:1, 375:1/2, 828:1.81/2,}

③ config/index.js to add postcss-px scale to mini postcss section

"Postcss - px - scale" : {" enable ": true," config ": {" scale" : 0.5, / / zoom for 1/2 "units" : "the RPX," "includes" : [" taro - UI "]}}

H5 PostCSS section added

"Postcss - px - scale" : {" enable ": true," config ": {" scale" : 0.5, / / zoom for 1/2 "units" : "rem", "includes" : [" taro - UI "]}}