postcss-pxtorem
postcss-pxtorem copied to clipboard
Convert pixel units to rem (root em) units using PostCSS
My project uses vue3+Vant4+vite with [email protected], after building the project. Some css files not covert px to rem properly. Anyone know this root cause?  Project config show as the...
I'm building a mobile project using Vite, Vant, and PostCSS-pxtorem. When I run npm run dev, the CSS units of Vant's global variables are compiled to rem. However, after a...
``` module.exports = { plugins: { 'postcss-pxtorem': { rootValue({ file }) { console.log(file, file.includes('node_modules/vant')) return file.includes('node_modules/vant') ? 37.5 : 75; }, propList: ['*'], }, }, } ```
I am currently using vite+vue3 to build the project and only want to do rem adaptation for mobile, this is my code: exclude: function (file) { return file.indexOf('m/') === -1...
eg: .wrap{height:100px;height:100px;} -> .wrap{height:10rem;height:100px;}
Hello there! Is there any way to let postcss-pxtorem to convert the css var values? It is not automatically converting my ``` --text-lg: 16px; ``` to ``` --text-lg: 1rem; ```...
add exclude verify type of RegExp: if exclude type is Function, it has a bug eg: postCssPxToRem({ exclude: (filePath) => { const reg = /src\/pages\/m|src\/components\/m|share\/components\/m/; return !reg.test(filePath); }, }) if...