logoalt Hacker News

invalidSyntaxtoday at 6:25 AM1 replyview on HN

I can agree that CSS is really unpredictable. However ,not being able to put CSS in a file isn't a small change. It makes other people to read the code harder, and mixing css and js just doesn't feel right. But just to keep my self safe, I know how people reacted to react at first. This might be normal in the future. Maybe.


Replies

tenphitoday at 9:01 AM

Exactly. And we won't find out if we don't try. Also, specifically, this approach is more JSON-based (compared to other CSS-in-JS). So you can easily put styles into a separate file if you want, JS or JSON. But I prefer defining styled components in a separate file, as `styled-components` recommends.