Design and branding

Dark mode: iOS 13 and Android 10 are here, how should a site respond

Phones moved to a system-wide dark mode. What to check so your site does not look bad for those users, and how to support it with CSS.

Dark mode: iOS 13 and Android 10 are here, how should a site respond

In September iOS 13 and Android 10 shipped, and both main mobile systems now have a system-level dark mode. The user turns it on once and apps and the browser adapt. Browsers also let sites know: the CSS prefers-color-scheme query works (Chrome, Safari and Firefox already support it).

What changes for a site?

If you do nothing, most browsers will show the site as it is, on a white background. That is not the worst case. The worst case is half-adaptation: a dark background but dark text, or a black logo with a transparent background.

Checklist

  • Contrast. Text must stand out from the background; choose soft tones instead of pure white and pure black.
  • Logo. A dark logo with a transparent background vanishes on dark; prepare a light version.
  • Images. Images with white backgrounds look "stuck on" a dark page.
  • Colour variables. Define colours as CSS variables so the dark version is managed from one place.

A simple example

The main colours live in one block and are overridden inside @media (prefers-color-scheme: dark). If you like, you can add a toggle button for the user too.

Is it mandatory? No, but there are many mobile users and comfort at night makes a difference. Design and adaptation: website services.

Found it useful? Share it:

Get new articles by email

One or two emails a month: practical tips on websites, hosting and security. Unsubscribe any time with one click.