Hacker News new | ask | show | jobs
by dahart 3181 days ago
Last time I checked, CSS-in-React didn't have 100% CSS coverage, there were some things you still have to do natively. Has that been fixed recently?

CSS-in-React is sometimes pretty useful, but personally I'm not in love with it... because the attribute names are camel-cased, and you're running JS code to set styles that the browser already has a mechanism for that doesn't need to run code.

1 comments

Several CSS-in-JS libs support all of CSS, and allow you to write actual CSS and not camelCase styles.

styled-components [1] is prob the most popular example.

Your complaint they are evaluating JS just to set styles is valid, tho some libs, like emotion [2] support static CSS extraction.

[1] https://www.styled-components.com/docs/api#supported-css [2] https://github.com/emotion-js/emotion