cssinjs / aphrodite-jss

Aphrodite-like API on top of JSS.
MIT License
92 stars 17 forks source link

Enable global rules such as @import and @keyframes #22

Closed msnider closed 6 years ago

msnider commented 6 years ago

It seems to me that rules including @global, @keyframes, @charset, @font-face, and @import should be passed to JSS directly without running generateClassName on them. This means @keyframes can be used similar to how they are described in the JSS documentation: https://github.com/cssinjs/jss/blob/master/docs/json-api.md#keyframes-animation

An alternative would be to more closely replicate aphrodite and look at the styles and generate the appropriate rules when calling the css method (probably would more than double the LOCs).

kof commented 6 years ago

Too bad we have no tests here, I trust you have tested this. On the other note, as a micro optimization I would use name[0] === '@', it will be faster

msnider commented 6 years ago

Ok, I updated to your recommendation and added a quick test.

kof commented 6 years ago

lgtm

kof commented 6 years ago

released 2.1.0

kof commented 6 years ago

🎉