ClickNote
ClickNote
Try the live demoStart free trial

The demo needs no sign-up. The trial needs no card.

Open dashboard
Choose a plan
Dashboard
Start free trial

The trial needs no card.

Web design styles - colour and texture

Dark mode web design

Dark mode web design uses light text on dark surfaces, either as a site’s main look or as a theme people can switch to. Depth comes from slightly lighter layers rather than shadows, and colours are tuned so they still read on a dark background. Most operating systems now offer a dark setting, and many people expect websites to follow it.

A live example

This sample page is built with this page’s own CSS. Switch to the common mistake to see why dark mode is more than swapping black and white.

Spring trips

Plan your next weekend away

Pick a city, choose your dates and we’ll put the whole trip in one place.

Flights

Compare times and fares in one list.

Search flights

Stays

Hotels and flats near where you’ll be. Pick by area, price or how close you are to the station.

Find a stay

Things to do

Tours, tables and tickets, booked ahead.

Browse ideas

Done well: a very dark grey rather than black, slightly lighter surfaces for depth, off-white text, and links in a lighter blue that reads on dark.

What makes it dark mode

Dark grey, not black

Backgrounds around #0f1115 to #1a1d23 rather than pure black.

background: #0f1115

Lighter layers

Raised surfaces get lighter, because shadows don’t show on dark.

background: #181b21

Off-white text

Text slightly below pure white, to cut glare.

color: #e8eaed

Retuned colours

Brand colours lightened or desaturated so they still pass contrast.

color: #7aa8ff

The CSS

This snippet sets up both themes with custom properties and follows the visitor’s system setting. A toggle only has to switch the data attribute.

dark-mode.css
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f4f5f7;
  --text: #15171a;
  --muted: #585a5f;
  --link: #1d4ed8;
  --border: #d9d8d1;
}

/* Follow the system setting */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115;
    --surface: #181b21;   /* lighter layers instead of shadows */
    --text: #e8eaed;      /* off-white, not pure white */
    --muted: #a0a7b1;
    --link: #7aa8ff;      /* lightened so it reads on dark */
    --border: #2c313a;
  }
}

/* A manual toggle wins over the system setting */
:root[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #181b21;
  --text: #e8eaed;
  --muted: #a0a7b1;
  --link: #7aa8ff;
  --border: #2c313a;
}

body { background: var(--bg); color: var(--text); }
.card { background: var(--surface); border: 1px solid var(--border); }
a { color: var(--link); }

Tuning the values

PropertyA good starting rangeWhat goes wrong outside it
Background#0f1115 to #1a1d23Pure black makes white text glare and smears on some screens as you scroll.
Body text#d0d4da to #e8eaedPure white is tiring. Too grey and it fails contrast.
Surface stepsAbout 4 to 8% lighter per layerToo close and layers merge. Too far apart and it looks like a light theme.
Brand coloursLightened 15 to 30%The light theme’s brand colours usually fail on dark backgrounds.

When it works

  • Developer tools, apps, media and gaming sites.
  • Photography and video portfolios, where dark surroundings make images stand out.
  • Any site as an option that follows the visitor’s system setting.

When to avoid it

  • Long reading pages as the only option, since some people find light text on dark harder to read.
  • Brands built around light, airy colours, unless you design a proper dark version.
  • Print-heavy content, such as recipes or tickets people print.

Light and dark

Supporting both themes properly

Most sites that offer dark mode also offer light mode. The best ones follow the visitor’s system setting by default and let them override it, and they treat dark mode as its own design rather than an inverted copy.

  • Set color-scheme

    color-scheme: light dark tells the browser to style scrollbars, form fields and other built-in controls to match.

  • Remember the choice

    Store a manual toggle in localStorage and set it before the page paints, so it doesn’t flash light first.

  • Check images and logos

    Dark logos and transparent PNGs disappear on dark backgrounds. You may need a light version of each.

  • Design every state

    Hover, focus, disabled, error and success colours all need their own dark values.

What to check when you review a dark mode site

Dark mode problems often only appear in one theme, so every check below means looking at both.

  1. :root

    1. Pure black and pure white

    Check the background isn’t pure black and the text isn’t pure white. That combination glares.

  2. a

    2. Brand colours on dark

    Check links, buttons and accents reach 4.5:1 on the dark background. The light theme’s colours often don’t.

  3. .card

    3. Depth without shadows

    Shadows don’t show on dark. Check cards and menus are separated by lighter surfaces or borders.

  4. img, svg

    4. Logos and images

    Check dark logos, icons and transparent images still show on dark backgrounds.

  5. html

    5. A flash of the wrong theme

    Reload the page with dark mode on and check it doesn’t flash light first.

  6. input, select

    6. Form fields and controls

    Check form fields, dropdowns and scrollbars switch too, which needs color-scheme.

  7. .error, .success

    7. Status colours

    Check error, warning and success messages are still readable and distinct in dark mode.

  8. @media print

    8. Printing

    Check the page prints on white, since most people don’t want a page of black ink.

Reviewing with clients

Notes on the exact element that breaks in the dark

Dark mode bugs only show up for clients who have it switched on, which you often won’t know. ClickNote records the device with every note, so you can see what they were using. With ClickNote, clients click directly on elements of the website and leave a note, without creating an account or installing a browser extension.

  1. Send your client a review link for the page.

  2. They click the logo, link or panel that looks wrong and say what they see.

  3. You get the selector, a screenshot and their device, so you can go straight to the right rule in your CSS.

Note 1Open

This link is really hard to see on my phone at night.

mobile · Safari on iPhone - 390 x 844

.d-card.c2 > .d-link
A client’s note pinned to the exact link, with its selector.

Reviewing a site in one of these styles?

Send your client a review link and they can click directly on elements of the website and leave a note, without creating an account or installing a browser extension. You get the selector, a screenshot and their device with every note.

14-day free trial. No card needed. See pricing.

Live demo

Try the live demo

We will set up a demo account for you.