Modern CSS Code Snippets: Stop writing CSS like it's 2015

modern-css.com

123 points by eustoria 5 hours ago


ktpsns - 2 hours ago

CSS in 2025: Let's write html inlined styles as if it was 2005 and separation of formatting/representation was never invented. I talk of tailwind, of course.

deadghost - 21 minutes ago

So where are we at with utility libs (tailwind/tachyon) vs inline css in js vs preprocessors (sass/scss) vs vanilla modern css?

lol768 - 14 minutes ago

I'm confused, many of these examples state that they don't work in my browser (Firefox) - but the live demo works fine? Are the demos poly-filled?

cwillu - an hour ago

Stop pinning things to the edges of the screen and window. Some sites have literally over 50% of the viewable area taken up by irrelevant static elements. Let the content scroll, like god intended.

Bengalilol - 2 hours ago

Me: cool, let's be creative, I love 2026.

Browsers: Yeah, but beware of limited availability, most of those creative examples are in the 40-50% browsers support range.

anematode - an hour ago

Random pet peeve... it annoys me when people have old browser-specific aliases to standardized CSS properties. For example, -o-tab-size and -moz-tab-size instead of just tab-size. Those properties haven't done anything on Opera/Firefox for a decade!

jgalt212 - 2 hours ago

CSS and JavaScript are like two dysfunctional law enforcement agencies fighting over jurisdiction.

piskov - 2 hours ago

2015 is good enough.

For example instead of grid center, one can use flex and margin auto.

If you are building really nation-wide products, there are still a lot of guys in corporate with old windows (where even chrome stopped updating like win7). Or, you know, old or poor people with PC from 2008.

Also don’t forget guys with mobile phones: not like one could easily install a browser there. Especially on phones which no longer receive updates.

So writing CSS like it is 2015 is great. Not because it feels great but because it is what caring about your users (and business) is.

Otherwise you’ll get humbled by your clients soon enough. And in corporate they won’t even be your clients unless you support old stuff: IE 11 is a great target if you really want to shine.

egedev - 7 minutes ago

[dead]

user3939382 - an hour ago

CSS is the only thing from browsers we actually need. The rest can be done in a terminal. Contemporary terminals could even render the UI with way less memory. The browser is a nightmare because it wasn’t architected to run applications.

laacz - 2 hours ago

Is it just me or gradients and tile grid with specific hover effects are AI generated stuff giveaways? Maybe it's old people yelling at clouds, but I'm very reluctant to trust the site, when I see these signs.