r/javascript • • Oct 16 '22

Why We're Breaking Up with CSS-in-JS

https://dev.to/srmagura/why-were-breaking-up-wiht-css-in-js-4g9b
319 Upvotes

226 comments sorted by

View all comments

Show parent comments

4

u/-keystroke- Oct 16 '22

The entire premise of the tailwind classes is that you can guess at the class names of you know css. And intellisense fills in the gaps. If your new hires have trouble with it they aren’t good with vanilla css. Tailwind is not complex or a new language, and how would the issue you raised be any different if you just had custom css classes and need to go look at their definitions?

3

u/Ashtefere Oct 16 '22

Css modules is generally better in our case.

4

u/superluminary Oct 16 '22

My issue is that css attributes are a simple and transferable skill. Tailwind class names are not transferable and represent a layer sitting between me and these very simple attributes which I know intimately.

I don’t see why this is necessary or good. If I want two things next to each other, I’ll just pop out a flex. If I want a breakpoint, I’ll drop in a media query. If a styling bug comes up, the styles are right there, next to the code they are styling.

CSS is already a configuration language. It doesn’t need an abstraction layer.

As always, I’m willing to be wrong on this.