Live data from Hacker News

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

modern-css.com

11–20 of 318 posts

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

#13
post #9
post #4

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.

Yeah let's do that. You have everything related to your component on place instead of jumping between files.

Is jumping between files supposed to be difficult or something?

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

#14

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.

In the past this was a major issue that meant useful features were only ever usable after IE/Safari finally supported them half a decade later, but it has seriously gotten better. Sadly as a result of Chromium's overbearing presence, but it's a helpful outcome at least.

https://wpt.fyi/interop-2025

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

#15
post #13
post #9

Earlier quoted context omitted.

Yeah let's do that. You have everything related to your component on place instead of jumping between files.

Is jumping between files supposed to be difficult or something?

Also modern CSS is often written in a tag either in a native web component or in a framework which supports single file component like vue or svelte.

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

#16
post #3

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…

I definitely don't agree with all of these, but grid centering is pretty nice and has a lot fewer quirks than Flexbox based solutions.

[deleted]

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

#17
post #13
post #9

Earlier quoted context omitted.

Yeah let's do that. You have everything related to your component on place instead of jumping between files.

Is jumping between files supposed to be difficult or something?

Colocation is a useful principle in component-based architecture.

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

#19
post #4

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.

Tailwind is a direct response to how the "C" in "CSS" actually sucks, so there's no surprise that it's so popular.

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

#20
post #4

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.

Wait until you see React & JSX...

At least html and CSS are both presentation. React/JSX now confuses presentation and business logic.

Post reply on HN