News for hackers. Stuff that matters.
Re:Modern CSS Code Snippets: Stop writing CSS like it's 2015 by paradox460 on Sunday February 15, 2026 @09:51PM (#47030339)
Vue, Svelte, and Surface manage to do this without forcing you to inline all your styles
Re:Modern CSS Code Snippets: Stop writing CSS like it's 2015 by h4x0rr on Monday February 16, 2026 @02:00AM (#47031755)
I worked with both. Scoped styles are nice. Tailwind is better - no naming of every element, no mental tax of jumping around in the file -
Re:Modern CSS Code Snippets: Stop writing CSS like it's 2015 by Kiro on Monday February 16, 2026 @07:04AM (#47034002)
Jumping up and down in the file is not much better and you still need to come up with names for classes. I want to look at an element and immediately know how it's styled.
Re:Modern CSS Code Snippets: Stop writing CSS like it's 2015 by agos on Monday February 16, 2026 @09:56AM (#47035797)
From Tailwind's home page:

<div class="h-112 p-4 sm:p-8 relative overflow-hidden rounded-lg bg-gray-950/[2.5%] after:pointer-events-none after:absolute after:inset-0 after:rounded-lg after:inset-ring after:inset-ring-gray-950/5 dark:after:inset-ring-white/10 bg-[image:radial-gradient(var(--pattern-fg)_1px,_transparent_0)] bg-[size:10px_10px] bg-fixed [--pattern-fg:var(--color-gray-950)]/5 dark:[--pattern-fg:var(--color-white)]/10">[...]

"immediately" is a stretch

Re:Modern CSS Code Snippets: Stop writing CSS like it's 2015 by Kiro on Monday February 16, 2026 @10:33AM (#47036292)
You can fold it, format it, and IDEs preview it. This is like me posting the equivalent CSS in one big line. But even without all that I still prefer this over dealing with cascading styles in stylesheets. Never again.
Re:Modern CSS Code Snippets: Stop writing CSS like it's 2015 by agos on Monday February 16, 2026 @10:54AM (#47036593)
dealing with the cascade and tailwind are not the only two options
Re:Modern CSS Code Snippets: Stop writing CSS like it's 2015 by rafark on Monday February 16, 2026 @12:22PM (#47037631)
Thanks for proving the point. I haven’t even seen that element rendered and I already have a good mental picture of what it is and what it looks like.
Re:Modern CSS Code Snippets: Stop writing CSS like it's 2015 by cush on Monday February 16, 2026 @01:02PM (#47038090)
I think your point has very little to do with tailwind and everything to do with CSS. Tailwind is optimized for modification and maintainability. We could replace your example with

<div class="hero-header hero-header--large">...

but now any time we want to modify hero-header, we're trolling through the whole site to find where else these classes might be used so we know what to test to avoid breaking anything

Sure it's easy to look at the element you shared and say it's too complex (it's really not, it's very declarative), but the complexity must live somewhere, and I'd choose Tailwind over any other prevailing system because it's isolated and safe to modify