Augment

Dark Mode Done Right: Tokens, Contrast, and Testing

Dark mode is not an inverted palette. It is a second theme with its own contrast, depth, and brand decisions.

A dark analytics dashboard showing retention and usage charts
Photo by Luke Chesser on Unsplash, with an Augment halftone treatment
Executive Summary

Key Takeaways

  • Build themes with semantic tokens, so each role maps to a light and a dark value.
  • Do not use pure black and pure white. Slightly softened values reduce eye strain.
  • Check contrast for text, icons, and borders in both themes.
  • Test images, charts, and shadows. They often break first.

Why it is more than inversion

Flipping every color rarely works. Brand colors may vibrate on dark backgrounds. Shadows lose meaning. Imagery with white backgrounds glows. Treat dark mode as a design in its own right.

Use semantic tokens

Define roles like background, surface, text, border, and action. Map each to a light and a dark value. Components reference roles only, so switching themes needs no component changes.

TokenLightDark
color.backgroundOff-whiteNear-black, not pure black
color.surfaceWhiteA step lighter than the background
color.text.primaryNear-blackOff-white
color.borderLight greyDark grey
color.actionBrand accentAdjusted for contrast on dark

Create depth without shadows

In light themes, shadows show elevation. In dark themes, shadows are barely visible. Use slightly lighter surfaces for higher layers, and subtle borders to separate content.

Check contrast

WCAG sets minimum contrast ratios for text and for non-text elements like icons and input borders. Check both themes. Brand colors that pass on white often fail on dark backgrounds and need a lighter variant.

Test the awkward cases

  • Charts: make sure series colors are distinguishable on both backgrounds.
  • Images and logos: provide dark-friendly versions or transparent backgrounds.
  • Form states: focus, error, and disabled need clear contrast.
  • System preference: respect the user's operating system setting, and let them override it.

Frequently Asked Questions

Use semantic tokens that map each role to separate light and dark values, and have components reference roles only.

Sources and further reading

  1. Web Content Accessibility Guidelines (WCAG) 2.2W3C · Published · Updated · Accessed
  2. Design Tokens Format Module (2025.10)Design Tokens Community Group · Published · Accessed
  3. Material Design 3Google · Undated page · Accessed
  4. Human Interface GuidelinesApple · Undated page · Accessed

Credits

  • Written by Augment Editorial Team, Product design and engineering, Augment Lab.
  • Cover photo Photo by Luke Chesser on Unsplash, with an Augment halftone treatment, used under the Unsplash License.
  • Research Statistics and standards are cited from the sources above. Always check the original page for the latest version.

Augment Product Design

Ready to make your product clearer?

From first concept to go-live, we turn complex product ideas into clear, useful experiences.

Dark Mode Done Right: Tokens, Contrast, and Testing | Augment. Lab