📐Dark Mode
Also known as Dark Theme, Night Mode, prefers-color-scheme
A theme with light text on a dark background. It often follows a phone setting.
Think of it like
It is like turning down the lights in a room at night. Same room, easier on the eyes.
Example
Leo's phone switches to dark at sunset. His banking app follows, with dark grey screens and soft white text.
Why it matters
Many people use it all day, and a broken dark mode is seen at once.
Definition
Example code
css
@media (prefers-color-scheme: dark) {
:root { --color-background: #121212; --color-text: #e6e6e6; }
}Common mistake
Key takeaways
- 1Follow the setting. And let people choose.
- 2Dark grey, not black. Softer on the eyes.
- 3Recheck contrast. Colors need tuning.