Skip to content
IndexRequest a UIAboutContact

Dark Mode Token Pairs

Light, a tuned dark theme and a naive invert side by side, with live contrast ratios for each token pair.

Open alone ↗

AI prompt

PROMPT: PASTE INTO YOUR AI IMAGE OR VIDEO TOOL
UI design sheet showing the same settings card in three themes side by side: a light theme, a carefully tuned dark theme with dark grey background, slightly lighter card surface, off-white text and a soft light-blue accent, and a naive inverted version with pure black, pure white text and a harsh saturated blue accent that visibly vibrates, small contrast ratio labels under each, flat modern style, clean spacing. Negative: gradients, shadows, text errors, device frames. Reduced motion: static sheet.

About this pattern

Definition

A good dark theme is not an inverted light theme. It maps each semantic role, such as background, surface, text and accent, to a new value: dark grey instead of pure black, off-white instead of pure white, and a lighter, slightly desaturated accent.

When to use it

  • Background near #121214 rather than #000, with surfaces one step lighter to show elevation.
  • Text near #ECECE8 so it does not glare; muted text still above 4.5:1.
  • Raise the accent's lightness and lower its saturation so it does not vibrate on dark.
  • Define tokens once and switch the values, never the components.

What the controls do

  • Three theme buttons; a sample card and a live contrast table.

Motion & timing

  • The theme swaps instantly.
  • Reduced motion: nothing animates.

Tips & variations

  • Test every text and surface pair in both themes, including muted text.
  • Respect prefers-color-scheme as the default and let people override it.

Code of this live preview

HTML
<div class="bx"><div class="pre" id="pre" role="group" aria-label="Theme"><button data-p="0" aria-pressed="true">Light</button><button data-p="1" aria-pressed="false">Dark</button><button data-p="2" aria-pressed="false">Naive invert</button></div><div class="th" id="th"><div class="cd"><b>Notifications</b><span>Get a summary every morning.</span><u>Turn on</u></div></div><div class="tb" id="tb"></div></div>

Related patterns

Semantic Colour Roles

↗
Semantic Colour RolesPalettes by Concept

Contrast Ratio Checker

↗
Contrast Ratio CheckerColour Techniques

Sun-Moon Theme Toggle

↗
Sun-Moon Theme ToggleMicro Interactions