some errors when px converts to rem
- Dominant language
- JavaScript
- Stars
- 2.2k
- Forks
- 173
- PR merge metrics
- No merged PRs in 30d
Description
Configure rootValue by function, There are some errors that px converts to rem.
I use development environment:postcss-pxtotem v6.0.0, vite2.0+, vue3. At the same time,I use vue3 component library vant3.0+。to match the Vant style,I do as follow in file postcss.config.js:
```javascript
const path = require('path');
module.exports = {
plugins: {
'postcss-pxtorem': {
rootValue({ file }) {
return file.indexOf('node_modules' + path.sep + 'vant') !== -1 ? 37.5 : 75;
},
// rootValue: 75,
propList: ['*'],
selectBlackList: ['.norem'],
},
},
};
```
Access the page in the browser,that is no problem. As shown in the figure below,browser got a index.6f88061b.css file that dose not refer to Vant component library。index.6f88061b.css file is about page logic and when make px converts to rem in this file the calculator uses rootValue 75. example, height of `.top_tile `class is 2.8rem.Everything is all right.

however, somtimes there are some errors when I access page browser.The page content becomes larger resulting in out-of-browser size.and browser got another css file named index.82969300.css not index.6f88061b.css. height of `.top_tile` class becomes twice the height.now the height is 5.6rem.

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.