Dark Mode Web Design: Why It's More Than Just a Colour Scheme

Dark mode is a design trend that's now a user expectation. But doing it well requires understanding contrast ratios, colour science, and how people actually read screens. Here's the full guide.

L
LocalWebsCoder

In 2019, Apple added system-wide dark mode to iOS 13 and macOS Mojave. Within months, dark mode adoption went from a niche developer preference to a mainstream user expectation. By 2024, over 82% of smartphone users use dark mode either always or some of the time (Android Authority survey).

Your website visitors are looking at dark interfaces everywhere. When they arrive at your site and it blinds them with a white background at 11pm, you've already lost ground.

But dark mode done badly is worse than no dark mode at all. Here's how to do it properly.

It's Not Just "Invert the Colours"

The most common dark mode mistake is treating it as a simple palette swap — make the background dark, make the text light, done. This produces flat, amateurish interfaces that lack depth and are often harder to read than they were in light mode.

Good dark design is a different discipline from light design. The physics of how light interacts with dark surfaces is genuinely different.

The Science of Dark UI

On a white screen, everything is illuminated by the screen's backlight. Contrast comes from dark elements on a light surface.

On a dark screen, you're working with the opposite: you need to create the illusion of depth and hierarchy using elevation rather than contrast alone.

Google's Material Design documentation describes this well: in a dark UI, surfaces that are "higher" in the UI (closer to the user, more important) should be lighter than the base background. Not dramatically — a few percentage points of lightness is enough.

In practice:

:root {
  --bg:     #060610;   /* Base — deepest surface */
  --bg2:    #0c0c1a;   /* Secondary background */
  --card:   #10101f;   /* Cards — one level "up" */
  --border: #1a1a30;   /* Subtle separators */
}

Each level is slightly lighter than the one below it. This creates visual hierarchy without relying purely on borders or drop shadows.

Contrast Ratios Are Non-Negotiable

WCAG 2.1 requires a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text. In dark mode, it's easy to accidentally use greys that look readable to you on your calibrated monitor but fail entirely for users with low-contrast screens or visual impairments.

Tools to check your ratios:

The temptation in dark mode is to use a very dim grey for secondary text. Something like #555 looks fine on your MacBook Pro with a 1000-nit display. On a cheaper Android phone, it's nearly invisible.

Our text colour hierarchy:

Pure Black Is Usually Wrong

#000000 for a background feels logical but creates a harsh, jarring interface. The eye struggles with extreme contrast transitions on self-illuminated screens in a way it doesn't with printed text.

Most good dark interfaces use a very dark navy, charcoal, or near-black instead:

A slight colour tint to your base background — even just barely perceptible blue or purple — makes the interface feel more crafted and less like a system terminal from 1985.

Colour Saturation in Dark Mode

Bright, saturated colours vibrate on dark backgrounds. A #FF0000 red that looks fine on white becomes aggressive and almost painful on pure black.

The rule: desaturate your accent colours slightly for dark mode use. If your brand colour is a vivid blue, pull it back 10–15% in saturation and you'll find it reads better without losing its identity.

Compare:

Using CSS prefers-color-scheme

The right way to implement dark mode respects the user's system preference. CSS provides a media query for exactly this:

/* Light mode (default) */
:root {
  --bg: #ffffff;
  --text: #111111;
}

/* Dark mode — auto-applies when OS is set to dark */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #060610;
    --text: #eaeaff;
  }
}

You can also layer a manual toggle on top — a button that adds/removes a data-theme="dark" attribute on the element — for users who want manual control regardless of system setting.

Typography Adjustments for Dark Mode

Type reads differently on dark backgrounds. A few adjustments improve readability significantly:

The Dark Mode Checklist

Before you ship a dark UI:

Dark mode is not a shortcut to looking technical. Done right, it's an accessibility improvement, a battery saver on OLED screens, and a signal to your users that you've thought carefully about their experience.

Done wrong, it's just a dark background with unreadable text.

Tags: web design dark mode UI design CSS accessibility
← Older

Why Local Businesses Need a Bespoke Website (Not a Template)

More in Web Design

Web Design

Why Local Businesses Need a Bespoke Website (Not a Template)

Template websites look the same, load slowly, and rank poorly. Here's why a bespoke, hand-coded site…

Web Design

Web Accessibility in 2025: The Legal and Business Case for Building Inclusive Websites

1 in 5 people in the UK have a disability. WCAG compliance is becoming a legal requirement for more …

Need a website for your business?

We build fast, affordable, and secure websites for local businesses across the UK.

Get a Free Quote