4 ms·
Too many web developers assume everyone loves Dark Mode, default to that, and defend their choice by pointing to the toggle button that says Dark/Light Mode. I’
by Brajeshwar 2y ago
Too many web developers assume everyone loves Dark Mode, default to that, and defend their choice by pointing to the toggle button that says Dark/Light Mode. I’m surprised many, even with freshly done websites, still do not pick up on the user’s preferences and are set to it!
For developers, the `color-scheme` CSS property allows an element to indicate which color schemes it can comfortably be rendered in.[1]
:root {
color-scheme: light dark;
}
element { light-dark(light-color-code, dark-color-code);
For users on macOS, I like dark mode in some cases, such as the Menubar and the IDE, but light for other activities, such as reading, writing, and browsing. Hence, it is a mixed preference;
System Preferences, then set the theme to LIGHT, then run
defaults write -g NSRequiresAquaSystemAppearance -bool Yes
Logout, then System Preferences, then set the theme to DARK.
Reset back to the default theme.
defaults write -g NSRequiresAquaSystemAppearance -bool No
1. https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme https://developer.mozilla.org/en-US/docs/Web/CSS/color-schem...