Back to Blog
UI/UXDesignWeb Development

Designing for Dark Mode: A Complete Guide

Learn the principles and best practices for creating beautiful dark mode interfaces that are easy on the eyes and accessible.

Mithium Team · Design
January 5, 20253 min read
BLOG

Dark mode has evolved from a niche preference to a mainstream feature that users expect. Designing effective dark interfaces requires more than just inverting colors—it demands a thoughtful approach to contrast, hierarchy, and user experience.

Why Dark Mode Matters

Beyond aesthetic preference, dark mode offers real benefits:

  • Reduced Eye Strain: Especially in low-light environments
  • Battery Savings: On OLED/AMOLED screens
  • Accessibility: Helps users with light sensitivity
  • Focus: Reduces visual clutter and distractions

Core Principles

1. Avoid Pure Black

Pure black (#000000) on pure white text creates excessive contrast that causes eye strain. Instead, use dark grays that are easier on the eyes.

css
/* Avoid this */
.dark-theme {
  background: #000000;
  color: #FFFFFF;
}
 
/* Prefer this */
.dark-theme {
  background: #121212;
  color: rgba(255, 255, 255, 0.87);
}

2. Establish Clear Hierarchy

Use elevation and subtle background variations to create visual hierarchy. Higher surfaces should be lighter.

css
:root {
  --surface-0: #121212;  /* Background */
  --surface-1: #1E1E1E;  /* Cards, elevated content */
  --surface-2: #232323;  /* Modals, dropdowns */
  --surface-3: #282828;  /* Hover states */
}
Design Tip

In dark mode, elevation is indicated by lighter surfaces, the opposite of light mode where shadows create depth. Think of it as surfaces catching more light the higher they are.

3. Adjust Brand Colors

Saturated colors that work in light mode often appear too vibrant against dark backgrounds. Desaturate or lighten accent colors for dark mode.

css
/* Light mode accent */
.accent-light {
  color: #6200EE;
}
 
/* Dark mode accent - lighter variant */
.accent-dark {
  color: #BB86FC;
}

Typography in Dark Mode

Text readability is crucial. Use appropriate opacity levels for different text hierarchies:

Content TypeOpacity
Primary text87%
Secondary text60%
Disabled text38%
css
.text-primary {
  color: rgba(255, 255, 255, 0.87);
}
 
.text-secondary {
  color: rgba(255, 255, 255, 0.60);
}
 
.text-disabled {
  color: rgba(255, 255, 255, 0.38);
}

Implementing Dark Mode

CSS Custom Properties

Use CSS custom properties for easy theme switching:

css
:root {
  --bg-primary: #FFFFFF;
  --text-primary: #1A1A1A;
  --accent: #6200EE;
}
 
[data-theme="dark"] {
  --bg-primary: #121212;
  --text-primary: rgba(255, 255, 255, 0.87);
  --accent: #BB86FC;
}

Respect System Preferences

Always check for user's system preference:

css
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #121212;
    --text-primary: rgba(255, 255, 255, 0.87);
  }
}
Accessibility Note

Always ensure your dark mode maintains WCAG contrast ratios. Test with tools like WebAIM's contrast checker to verify readability.

Common Mistakes to Avoid

  1. Simply inverting colors - This rarely produces good results
  2. Using colored backgrounds - Stick to neutral grays
  3. Forgetting about images - Consider how photos and illustrations appear
  4. Ignoring transition states - Theme changes should be smooth

Conclusion

Great dark mode design requires intentionality. By following these principles—avoiding pure black, establishing clear hierarchy, adjusting colors appropriately, and respecting accessibility—you can create dark interfaces that are both beautiful and functional.

At Mithium, dark mode is at the heart of our design philosophy. We believe in creating interfaces that look stunning around the clock.

Share:

Related Posts

Step into the
future of design

Join thousands of designers and teams using Framer to turn ideas into high-performing websites, fast.

Get Started