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.
Stays
Hotels and flats near where you’ll be. Pick by area, price or how close you are to the station.
Find a stayDone 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: #0f1115Lighter layers
Raised surfaces get lighter, because shadows don’t show on dark.
background: #181b21Off-white text
Text slightly below pure white, to cut glare.
color: #e8eaedRetuned colours
Brand colours lightened or desaturated so they still pass contrast.
color: #7aa8ffThe 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.
: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
| Property | A good starting range | What goes wrong outside it |
|---|---|---|
| Background | #0f1115 to #1a1d23 | Pure black makes white text glare and smears on some screens as you scroll. |
| Body text | #d0d4da to #e8eaed | Pure white is tiring. Too grey and it fails contrast. |
| Surface steps | About 4 to 8% lighter per layer | Too close and layers merge. Too far apart and it looks like a light theme. |
| Brand colours | Lightened 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-schemecolor-scheme: light darktells 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.
:root1. Pure black and pure white
Check the background isn’t pure black and the text isn’t pure white. That combination glares.
a2. 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.
.card3. Depth without shadows
Shadows don’t show on dark. Check cards and menus are separated by lighter surfaces or borders.
img, svg4. Logos and images
Check dark logos, icons and transparent images still show on dark backgrounds.
html5. A flash of the wrong theme
Reload the page with dark mode on and check it doesn’t flash light first.
input, select6. Form fields and controls
Check form fields, dropdowns and scrollbars switch too, which needs
color-scheme..error, .success7. Status colours
Check error, warning and success messages are still readable and distinct in dark mode.
@media print8. 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.
Send your client a review link for the page.
They click the logo, link or panel that looks wrong and say what they see.
You get the selector, a screenshot and their device, so you can go straight to the right rule in your CSS.
This link is really hard to see on my phone at night.
mobile · Safari on iPhone - 390 x 844
.d-card.c2 > .d-linkReviewing 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.