What is your opinion about CSS-in-JS?
I had some "interesting" responses on Twitter over an observation I had that CSS-in-JS doesn't often come with a relatable use-case.
My opinion has always been: use the best tool for the job. When I first looked at CSS-in-JS it was because I was using a pattern library that included a 200K CSS file (compressed!). This wasn't okay. I wanted to only deliver the CSS that I was using in my components. CSS-in-JS appears to be a good match for this problem.
Coupled with the promise of scoped styled (i.e. no global styles interfering), the ability to automatically ensure only the used CSS is delivered, CSS-in-JS has its appeals.
The killer feature for me though, is if some CSS-in-JS tool can provide automatic, configuration-free, critical CSS.
I do know that I'll continue to use stylesheets when I want to avoid the headache of tooling though!