Dark Mode Design: A Comprehensive Guide for Web Developers

Designing Dark Mode for a Website

Dark mode needs its own palette and testing. Start with the roles colours play across your interface, including text, background, borders and status messages.

Define colours by purpose

Choose colours for each role and compare the actual combinations they create. Check links, muted text, errors and focus outlines as well as headings. Logos and illustrations may need versions that remain clear on both backgrounds.

Respect the visitor’s preference

Use the browser’s colour scheme signal where appropriate. If you provide a theme toggle, make it easy to find and use with a keyboard. Give the control an accessible name and show which choice is active.

Test complete pages and tasks

Check a menu, form and content page in both themes. Include disabled controls, selected items and third-party embeds. Our London web design team can help create a palette that works across your site.

Read MDN’s colour scheme reference