cuth / postcss-pxtorem

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

Allow whitelisting of all properties #9

Closed sndrs closed 9 years ago

sndrs commented 9 years ago

I'd like to switch to use this in gulp from grunt on The Guardian, but currently we expect to remify all units. This PR would to enable that with prop_white_list: 'all'.

This could be particularly useful used with the new selectorBlackList.

Incidentally, interested to know why you didn't want to whitelist all props by default?

cuth commented 9 years ago

Do you have any problem with us changing this to check if the prop_white_list array is empty then don't filter using the prop_white_list?

if (propWhiteList.length && propWhiteList.indexOf(decl.prop) === -1) return;

I personally only found it useful to convert font related units to REM but I'm happy to see people are finding other good uses.

sndrs commented 9 years ago

nope, none at all, that's nicer actually. i'll amend the PR…

sndrs commented 9 years ago

this will introduce a breaking change i guess though? the defaults will no longer be present. how do you feel about that?

cuth commented 9 years ago

I think that makes sense to default to empty array. Breaking change it is.

cuth commented 9 years ago

I've taken your suggestions and released them in 2.3.0. I didn't change the defaults so as not to make a breaking change. Sorry I didn't use your pull request. Thank you for your help. Feel free to submit more PRs or ideas.