A postcss plugin to resize px in src.
Project reference:https://github.com/songsiqi/px2rem-postcss
npm install postcss-px-resize --save-dev
In Webpack 3, add .postcssrc.js
PostCSS config file:
module.exports = () => ({
plugins: {
"autoprefixer":{
// remove: false
browsers: ['iOS >= 7', 'Android >= 4.1']
},
"postcss-px-resize": {
scale: 0.5
}
}
})
- scale: target scale value, default is 0.5, eg: 50px in scss file will resize to 25px.