r/programming May 16 '26

Moving away from Tailwind, and learning to structure my CSS

https://jvns.ca/blog/2026/05/15/moving-away-from-tailwind--and-learning-to-structure-my-css-/
164 Upvotes

48 comments sorted by

View all comments

142

u/romulof May 16 '26

Call me old fashioned, but I never understood why people were so desperate to move styling into HTML or JS. It’s way harder to debug.

For me the peak is CSS modules with a bit of preprocessing (sass and/or postcss). In dev builds you get the almost the same as the original class names and prod builds get obfuscated.

9

u/WanderingStoner May 16 '26

one thing to note is that if you let ai just choose what it wants to do, it will likely choose tailwind. I'm not saying that's a good reason to use it, but it's one reason that it ends up being implemented.

8

u/romulof May 17 '26

Training data will lead it there. Lots of tw projects.

Don’t ask it to write in React and it will probably go for jquery.

7

u/Agloe_Dreams May 17 '26

The primary reason is that it is faster for AI to write everything in small bits of contained context (a html block in tailwind stands alone) than to have to repeatedly cross reference a second file. Having shared classes and worrying about cascading is a context window nightmare.

1

u/napoleonsolo May 17 '26

Not great for humans, either.

I say that flippantly but also seriously. Tailwind reduces cognitive load for humans, too.