Please please please don’t impose dark mode on your websites. Honor the user’s system settings.

There are plenty of people with visual impairments as common as astigmatism who can’t read light text on dark background, because it’s like staring at a strong lightbulb in the dark.

And it’s not hard. Just a few lines of CSS.

#accessibility

@sknob pro tip:

you can even completely save yourself from making a light/dark theme entirely by not setting any custom colors and just using
:root { color-scheme: light dark; }


(or dark light if you want to show dark when there's no preference)

and ta-da, you're now using the browser defaults for light and dark, which should be accessible by default :3
@alexia @sknob no preference doesn't exist anymore as far as I know, browser vendors decided to only implement light and dark and do light as the default and the standard was updated to reflect that
@lunareclipse @sknob @alexia wait they don't? istg this was still a thing, unless it's changed recently?
prefers-color-scheme - CSS | MDN

The prefers-color-scheme CSS media feature is used to detect if a user has requested light or dark color themes. A user indicates their preference through an operating system setting (e.g., light or dark mode) or a user agent setting.

MDN Web Docs
@solonovamax @sknob @alexia even if the UI has an option for no preference, browsers always send a preference to websites, that setting just means "whatever the OS suggests or light"