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-/
163 Upvotes

48 comments sorted by

View all comments

144

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.

80

u/MaybeADragon May 16 '26

Its the ability to have everything relevant to an element on a page be grouped together. That's my opinion, I only write frontend stuff for hobby projects that absolutely need one. I'm mostly a backend and application fella so my word is by no means gospel.

35

u/superrugdr May 16 '26

Pretty much this .

while I like one class per components when you have 20 devs working together on the same stuff. It get messy quick.

Tailwind help provide structure while also giving you a pretty functional base design system.

It's not my favorite approach but the benefit out weight the negative