Live data from Hacker News

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

modern-css.com

231–240 of 318 posts

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

#231
post #217

Earlier quoted context omitted.

I was recently doing some very specific web scraping of some very public very static documents. About 25% of them use a soup of divs with hashes for class names. Not a or or in sight. I am fine with the idea of what tailwind does but like at least using semantic tags where appropriate could be a thing.

Wait until sites start rendering to canvas. You will yearn for the days of div soup.

why should they? this has been a worry for some time, but I don't see it happening

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

#232
post #211

Earlier quoted context omitted.

Vue, Svelte, and Surface manage to do this without forcing you to inline all your styles

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.

From Tailwind's home page:

[...]

"immediately" is a stretch

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

#235
post #99

Earlier quoted context omitted.

Cognitive load of looking at 12 open files trying to understand what’s happening. Well, in fairness some of those 12 are the same file because we have one part for the default CSS and then one for the media query that’s 900 lines further down the file.

Css modules gets away from the larger sins of the massive global css files. If modules had existed much earlier it probably would’ve gotten rid of most of the awfulness.

CSS Modules are way older than Tailwind, but alas it was not enough

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

#236
post #82

Earlier quoted context omitted.

Yeah a lot of these demos say the features are widely available, but they don't actually work in my browser (Firefox on Macos). Makes me wonder if these demos (or the browser support tables) were made by LLMs. They clearly haven't tested the demos in firefox.

Firefox is pretty irrelevant nowadays. They've dragged their feet for years when it comes to implementing new stuff, and now web devs don't even bother checking Firefox. Because devs know it won't work on ancient browsers, no need to confirm. My personal trigger events were when Firefox didn't optimize DataView for the longest time, initially refused to implement import maps, and couldn't get WebGPU support done. At…

It's 2026, the most useful stuff was implemented over a decade ago. Stop trying to make the web platform do everything when it wasn't designed for that.

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

#237
post #82

Earlier quoted context omitted.

Yeah a lot of these demos say the features are widely available, but they don't actually work in my browser (Firefox on Macos). Makes me wonder if these demos (or the browser support tables) were made by LLMs. They clearly haven't tested the demos in firefox.

Firefox is pretty irrelevant nowadays. They've dragged their feet for years when it comes to implementing new stuff, and now web devs don't even bother checking Firefox. Because devs know it won't work on ancient browsers, no need to confirm. My personal trigger events were when Firefox didn't optimize DataView for the longest time, initially refused to implement import maps, and couldn't get WebGPU support done. At…

"widely available" has a precise meaning that includes Firefox (both desktop and Android). it might be irrelevant for some, but let's not twist industry definitions

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

#239
post #107

I dislike the examples here where the "old" way works in all browsers, but the "new" way only works in Chrome/Edge. IMO, it's irresponsible to include such examples, since it makes the Blink monoculture worse.

This site shouldn't be the one to blame. Instead, we should probably ask Mozilla to be more standards-compliant.

I don't see Mozilla obligated to follow whatever Google cooks up and declares a "standard".

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

#240
post #43
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.

The deadest horse in web development is the myth of “separation of concerns”

I can't believe this isnt better understood. Style definitions on reusable components are good. The idea that your css doesn't have to know about your html just creates tons of problems and complexity. Global themes and reusable styled are fine.

If we are talking about statically defined html then sure. make your global css files.

Post reply on HN