Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> The site won't retain the user's choice if you use plain CSS which is pretty horrible

Correct, that's why the suggested solution here is just as bad.

"Plain CSS" dark mode just follows your device’s setting via `prefers-color-scheme` @media query. Anything else is just unnecessary and should be suppressed. Just set your whole system once and be done.

That "Plain CSS" works perfectly and indeed does not need any JS nor different URLs (wut? who does that.)



Some people want dark mode for some things and light mode for others. I don't, but I know people who do.


Then those people should use a browser that lets them make that distinction. There is nothing saying that prefers-color-scheme needs to match the rest of the system or needs to be the same for all websites - but it should reflect what the user wants from that particular website so implemention an override on top of that should make no sense.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: