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

Please use `prefers-color-scheme` to respect users' environments and default preferences instead. It's also worth noting that, for some people, this is more than just a cosmetic choice.


From TFA:

>Automatically setting the theme is a nice touch for most, but accessibility comes first, and if the user has a preference, it's always right to respect their choice.

>You can check for users' colour scheme preferences in CSS & JavaScript with the following snippets:


I'm glad it's mentioned, but I was trying to say "never do the thing TFA recommends" in a less harsh way, and inadvertently dulled my point.




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

Search: