Re:Modern CSS Code Snippets: Stop writing CSS like it's 2015
by nine_k on Sunday February 15, 2026 @06:21PM
(#47028811)
Variables are hugely helpful, I agreee.
IDK about bikeshedding. I'm very used to writing React code that normally declares no styles for components at all, and having CSS that style components using 1-2 classes, specific to these components. Container components control margins, <body> controls general things like fonts.
It seems that what solves the problem is a good component library. "But I need red text here!" For what reason? It's a warning. OK, we've got <Text variant="warning">, it will be styled appropriately, and will look like every other warning in the application.
Re:Modern CSS Code Snippets: Stop writing CSS like it's 2015
by zeroCalories on Sunday February 15, 2026 @09:48PM
(#47030330)
I tend to think that if you're having issues with repeating yourself with stuff like tailwind you probably need to refactor your JSX/templates to share the repeated code. Keeping stuff like CSS isolated is a deliberate choice that helps massively with stuff like splitting code, and keeping changes side effect free.
Really what I want to see is beautiful TDD for CSS so that uniformity can be enforced, but I’m not sure that exists.