Post

The most interesting thing about css-in-js is its critics. Most criticism of css-in-js is very shallow and essentially boils down to "that is not was I was taught". It usually comes with oversimplified statements and a touch of name calling.

Bruce Lawson@brucel.bsky.social

Brogrammers couldn't wrap their megabrains around not-a-real-language CSS, so decided to reinvent it and fight against the web platform for their own convenience. Who could possibly have predicted it would be crap for users, and would need expensive surgery to drain the festering pus?

0 reposts5 likes

No. You are talking about a whole category. Css-in-js didn’t come about because people didn’t understand CSS. It came about because CSS has shortcomings. First generation wasn’t great. Later generations improved.

That is not to say there aren't valid criticisms of css-in-js solutions. There definitely is. Performance is a key one. But that is a criticism of individual libraries, not the concept in general.

Linaria and others emit essentially Tailwind style utility CSS if you want them to - the design time difference is ergonomics (writing real inline CSS) and the output is plain HTML & utility CSS or they emit plain old classes - my preference since it can load, deploy and update incrementally 🙂