1.0.3 • Published 3 years ago
postcss-unit-trasfer v1.0.3
postcss-unit-trasfer
A postcss plug-in that can convert CSS units
Convert px to rem!
You can customize units in the stylesheet to convert them to rem through this plugin.
install
npm i postcss-unit-trasfer
usage
webpack
// webpack.config.js
const PostCssUnitTrasfer = require('postcss-unit-trasfer');
module.exports = {
entry: {},
// ...
loader: {
// ...
// PostCssUnitTrasfer({ rootSelector: ':root', unit: 'upx', fontSize: 16 })
},
};
.main {
width: 100upx;
}
/* --> */
.main {
width: 6.25rem;
}