DEV Community

What are "HTML-CSS-JS" and "CSS-in-JS", anyway?

Betsy Haibel on January 30, 2019

Yesterday afternoon, an early-career developer I know DMed me to ask: "What are people defining as CSS-in-JS, anyway?" They had seen a lot of the d...
Collapse
 
ben profile image
Ben Halpern

Great little writeup. Folks definitely talk past each other in this debate and lots of folks on the sidelines rooting for some approach without really knowing the details.

One interesting thing about all of this is the sense of FOMO I felt about 3 years ago from people who were scared to miss adopting CSS-in-JS as if everyone was about to stop writing CSS tomorrow. Fast forward and we're still sort of in the same place. Interesting evolutions on both sides of this coin and new ideas to consider. It's okay to sit back and let things play out without getting to riled up.

Collapse
 
maxwell_dev profile image
Max Antonucci

As someone who was participating a little in this kind of discussion, I still wasn't fully aware of the different nuances and differences in the degree of CSS-in-JS one can write. This post is great for starting to clear all those up!

Collapse
 
chrisachard profile image
Chris Achard

Nice writeup - it can definitely be confusing with all the different possible ways to style something - plus all the different libraries that now do css-in-js (and keeping track of what is what).

I used to worry that I wasn't doing it "the right way" - but then realized, that no one is really doing it the "right way"! It's mostly all circumstantial: whatever works the best for your workflow and team.

Collapse
 
sebbdk profile image
Sebastian Vargr • Edited

CSS-in-JS conjured up the same horror from when i saw JSX.

Next we will see animals and humans fornicating, people in Denmark wearing colors, Trump making sense, spaces instead of tabs, what a chaotic and perverse world this would be!


Having pondered these ideas more these days, i kinda like them.
Maybe it was just too radical to accept initially. :D