dvtng / jss

JavaScript library for getting and setting CSS stylesheet rules
335 stars 55 forks source link

CSS property parsing #12

Closed barneycarroll closed 11 years ago

barneycarroll commented 11 years ago

I'm using JSS to produce transform rules, and it took me a while to work out that the reason it wasn't working with my translate3d(x,y,z)-format transforms was that it was validating input against the CSSOM and failing my passed values. I'm now using matrix(…)-format property values, and it's behaving.

This is an interesting design choice — why parse the input rules? Why not just pass the whole rule in as a string and see what the browser makes of it?

barneycarroll commented 11 years ago

So after reading through the source properly I see there's very granular interaction with the CSSOM, to the point where native objects are queried and set pretty much all the way. Makes a lot of sense (rather than keeping an internal state cache, and just dumping strings into a stylesheet).