cuth / postcss-pxtorem

Convert pixel units to rem (root em) units using PostCSS
MIT License
2.06k stars 172 forks source link

Pixel values in custom property names are converting too #44

Closed ryanve closed 4 years ago

ryanve commented 6 years ago

In our codebase we have some custom properties like --rem-16px: 1rem

If I run postcss-pxtorem with these then these variables are renamed like --rem-1rem: 1rem but I didn't expect that the property name would be replaced. Not sure if it's a big issue because I plan to remove those and replace with this plugin but still maybe there is a way to prevent that or is that the desired behavior?

2:14    ⚠  variable '--rem-1rem' is undefined and used without a fallback [postcss-custom-properties]
45:14   ⚠  variable '--rem-1rem' is undefined and used without a fallback [postcss-custom-properties]
48:14   ⚠  variable '--rem-2rem' is undefined and used without a fallback [postcss-custom-properties]