dvtng / jss

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

CSS property parsing #12

Closed barneycarroll closed 12 years ago

barneycarroll commented 12 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 12 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).