mattdesl / dom-css

fast dom CSS styling
MIT License
152 stars 13 forks source link

blacklist or whitelist for px? #1

Closed mattdesl closed 8 years ago

mattdesl commented 9 years ago

TweenLite uses a whitelist to only suffix certain properties [1]

jQuery uses a blacklist to suffix all properties except specific ones [2]

Which approach is best for a module like this? hmm

maxtherocket commented 9 years ago

I think a whitelist is better, as new properties become available you would have to always be in the know of what to blacklist and that can actually break things if you don't blacklist a specific property. For the whitelist, it's not a big deal if a new property is not 'px'ified, the dev could just add it herself. +1 for whitelisting

mikkoh commented 9 years ago

@mattdesl in my mind it's better to white list as there's way less numeric items you want to add 'px' to.

Your black list will have more items and harder to manage.

mattdesl commented 8 years ago

The behaviour is now the same as React & jQuery, using a blacklist. Pushed to 2.x since it is a major bump.