Guide

Dark Mode Web Design: How to Implement It Without Ruining Your Brand

Give your visitors the dark mode they expect — done properly.

Dark mode has moved from a developer preference to a mainstream user expectation. Operating systems, browsers, and apps all offer it, and a growing proportion of users browse the web with their system set to dark mode permanently. If your website ignores this preference, it can look jarring — a blinding white page against an otherwise dark interface.

Implementing dark mode well is more nuanced than simply inverting your colours. Done carelessly, dark mode can break contrast ratios, make images look odd, and clash with your brand palette. This guide walks through how to approach dark mode thoughtfully, covering CSS techniques, image handling, and user preference controls. At Xpose, we now consider dark mode compatibility a standard part of any new website build.

Detecting and Respecting the System Preference

The CSS media query prefers-color-scheme: dark lets your site detect whether a visitor’s operating system is set to dark mode and apply alternative styles automatically. Using CSS custom properties (variables) for all your colours makes this straightforward — define your light mode palette as defaults, then override them inside the media query. For example: :root { --bg: #ffffff; --text: #1a1a1a; } @media (prefers-color-scheme: dark) { :root { --bg: #121212; --text: #e8e8e8; } }. Every element that references these variables will update automatically.

This system-preference approach requires no JavaScript and works instantly without a flash of wrong-coloured content. It’s the baseline — but many sites go further by adding a manual toggle so users can override the automatic choice. A toggle stored in localStorage lets the preference persist across sessions without a server.

Colour Choices and Contrast in Dark Mode

The biggest mistake in dark mode design is using pure black (#000000) as the background. Pure black creates extreme contrast that causes eye strain, especially in low-light conditions. Google’s Material Design specification recommends #121212 as the dark mode surface colour. Similarly, don’t use pure white text on dark backgrounds — a slightly softened off-white like #e8e8e8 or #f0f0f0 is more comfortable to read.

Your brand colours may need adjusting for dark mode. Colours that look vibrant on white can look washed out or overly harsh against dark backgrounds. Saturated accent colours often need to be slightly desaturated and lightened. Test every colour combination against WCAG contrast requirements in both modes — a colour that passes in light mode may fail in dark mode and vice versa. Use a tool like WebAIM’s Contrast Checker on every combination.

Images, Icons, and Brand Elements

Images with white or light backgrounds look out of place in dark mode — you’ll see a glowing white box around product photos or logos. The solutions are: use PNG images with transparent backgrounds wherever possible, or apply CSS mix-blend-mode: multiply to images so light backgrounds blend with the dark page. For logos that are dark on white, provide alternative light-coloured versions for dark mode using the HTML <picture> element with a media attribute matching prefers-color-scheme.

SVG icons generally adapt well to dark mode if they inherit colour values from CSS rather than having colours hardcoded. Audit your icon sets for hardcoded fill="black" values and replace them with fill="currentColor" so they respond to CSS colour changes. At Xpose, we build icon systems this way by default so dark mode requires no separate icon assets.

FAQs

Common questions.

Should I offer dark mode if my brand is very colourful?
Yes — but adapt rather than simply invert. Work with your designer to create a considered dark mode palette that reflects your brand’s character while being comfortable to use. A thoughtful dark mode is better for your brand than a jarring automatic inversion.
Will dark mode affect my SEO?
Dark mode is a purely visual/CSS concern and has no direct impact on SEO. Search engine crawlers don’t render dark mode. However, a better user experience (which dark mode contributes to for many users) can indirectly improve dwell time and reduce bounce rates.
Does WordPress support dark mode?
WordPress itself doesn’t include dark mode, but modern themes built with CSS custom properties can be extended to support it. Most WordPress page builders (Elementor, Bricks, Kadence) now offer dark mode controls. A developer can also implement it from scratch with relatively little effort on a well-structured theme.
Related guides

More on web design & ux.

Want a hand putting this into practice?

Book a free, no-obligation consultation with a Norwich-based specialist.

Book a free consultation
Get started

Let's put your business in a better light.

Book a free, no-pressure consultation. We'll talk through your goals and tell you honestly what we'd do — whether you work with us or not.

  1. 01
    Tell us a bitFill in the form — two minutes, tops.
  2. 02
    We'll call you backWithin one working day, no pressure.
  3. 03
    Get a clear planHonest advice and a fixed quote.

Free · No obligation · We reply within one working day

Book a free consultation