UI/UX Design
2026.06.14 ยท 5 min read
Dark Mode Design: Why You Cannot Just Invert Colors
Slap a CSS invert filter and call it dark mode? Those sites hurt to look at.
โ Why Color Inversion Fails
- Images and logos break
- Contrast becomes too harsh, eye fatigue
- Saturated colors vibrate on dark backgrounds
๐จ 5 Dark Mode Principles
โ Do Not Use Pure Black (#000)
Good for OLED power savings, but contrast is too harsh. Use #0f172a, #18181b dark grays. Material Design recommends #121212.
โก Do Not Use Pure White Text
Use #f1f5f9 or rgba(255,255,255,0.87) instead of #fff. Pure white on black creates a halo effect that makes text vibrate.
โข Desaturate
Light mode #2563eb (sat 90%) becomes dark mode #60a5fa (sat 60%). Adjust HSL with Color Converter.
โฃ Use Brightness, Not Shadows, for Depth
Light mode separates layers with shadows. Dark mode hides them, so step up background brightness: #0f172a / #1e293b / #334155.
โค Maintain 4.5:1 Contrast
WCAG standard. Verify with the Contrast Checker.
๐ง CSS Variable Pattern
:root {
--bg: #ffffff;
--text: #1e293b;
--accent: #2563eb;
}
@media (prefers-color-scheme: dark) {
:root {
--bg: #0f172a;
--text: #f1f5f9;
--accent: #60a5fa;
}
}
๐ Tools
- Color converter: HEX/HSL/RGB
- Contrast: WCAG Contrast
- Palette: Palette Generator
๐ก Verify: stare at dark mode for 30 min then switch to light. No eye strain = OK, sore eyes = adjust contrast.
โ Back to Blog
PXLTool ยท 2026.06.14