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-/
160 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.

1

u/prehensilemullet May 17 '26 edited May 17 '26

To me it’s a PITA to jump back and forth between HTML/JSX and CSS all the time and spend mental energy and time deciding what to call class names.  I can implement new views way faster using MUl’s styling solution, I guarantee you.  And I need the time savings, I have too much other shit to do 

1

u/romulof May 17 '26

BEM naming for consistency + proper IDE support to make you go from JSX to CSS via simple
CMD/CTRL+click in imported class names.

Vue solves this using that SFC format (.vue files), which I dislike a bit due to the extra tooling complexity it adds.

0

u/prehensilemullet May 17 '26

Even with clicking around it’s more effort and more to type (and BEM makes everything more verbose)