cuth / postcss-pxtorem

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

hope to add propBlackList option #25

Closed guangfu closed 7 years ago

guangfu commented 8 years ago

sometimes need to ignore some css properties that translates px to rem, such as border. so hope to add propBlackList option

sndrs commented 8 years ago

would you be interested in a PR for this?

cuth commented 8 years ago

If it doesn't affect performance too much for those that don't use it.

sndrs commented 8 years ago

i guess you'd have to use either propWhiteList or propBlackList, since this wouldn't really make sense:

{
    propWhiteList: ['font'],
    propBlackList: ['font']
}

how about if you leave both of those options off, the default is to remify every prop (the equivalent of propWhiteList: [''] now), if you supply both you get an error, and if you supply one it's observed?

sndrs commented 8 years ago

maybe, in the case you tried to supply both options propWhiteList would always override propBlackList, and you get a warning instead?

KayLeung commented 7 years ago

I preferred BlackList always override WhiteList. Usually, I want to blacklist them because that have sub-pixels rendering problem in some cases.

cuth commented 7 years ago

In version 4.0.0 you can use a BlackList by just adding a wildcard to the propList:

{
  propList: ['*', '!border*']`
}