Skip to content
mailer.tools

Dark mode email: what clients do to your colours, and how to design for it

Email clients handle dark mode in three different ways, and you control only one of them. How each behaves, and the design habits that keep logos and text readable.

By 4 min read

The same email shown twice, light and inverted dark, with the logo staying readable in both thanks to a pale outline.

A large share of people read email in dark mode, and you cannot opt out on their behalf. When their app is dark, your email gets changed, and how it gets changed depends on the app. Some leave your colours alone, some swap only the light ones, and some invert everything.

The useful mindset is not "how do I make my email look exactly the same in dark mode". You cannot. It is "how do I make sure nothing becomes unreadable when someone else changes my colours".

The three behaviours

Email clients fall roughly into three groups.

No change. The client shows your email exactly as designed, even in dark mode. Your white background stays white. Several desktop and webmail clients behave this way for emails that set their own colours.

Partial inversion. The client looks for light backgrounds and dark text and swaps them, but leaves colours it considers already dark. Outlook.com and the Outlook mobile apps work this way, as does the Gmail app on Android. A white card with navy text becomes a dark card with light text. A deep blue button usually stays as it was.

Full inversion. The client inverts all colours, including those you already chose to be dark. Your dark header can become light. The Gmail app on iOS and classic Outlook for Windows in dark mode behave like this.

Only the first group gives you control through CSS. Some clients in it support the prefers-color-scheme media query, so you can supply your own dark palette. Apple Mail is the best known. The other two groups ignore your dark styles and apply their own algorithm.

Tell clients you have thought about it

Declare that the email supports both schemes in the <head>:

<meta name="color-scheme" content="light dark">
<meta name="supported-color-schemes" content="light dark">
<style>
  :root { color-scheme: light dark; }
</style>

Then, for the clients that honour it, add your own dark palette:

<style>
  @media (prefers-color-scheme: dark) {
    .email-bg { background-color: #0f1527 !important; }
    .email-card { background-color: #1a2238 !important; }
    .email-text { color: #e6e9f2 !important; }
  }
</style>

The !important is needed because your light colours are inlined on the elements, and inline styles beat the style block otherwise.

If your design only works in light mode, you can declare content="light" instead. Clients that respect it will leave the email alone; the inverting clients will still invert.

Logos are the usual casualty

The most common dark-mode failure is a dark logo on a transparent background. On white, it looks fine. When the client turns the background dark, a navy logo on a near-black background disappears.

Options, in order of reliability:

  1. Give the logo its own background. Export it with a solid white or brand-coloured rounded rectangle behind it. It will look like a badge in dark mode, but it will be legible everywhere.
  2. Add a thin light outline or glow around the dark parts of a transparent logo. Invisible on white, enough to keep the shape on dark.
  3. Swap the image in clients that support media queries: show a light version inside @media (prefers-color-scheme: dark) and hide the dark one. This only helps in the first group of clients.

The same applies to icons, dark illustrations and any image with transparency.

Colour choices that survive inversion

  • Avoid pure black on pure white. #000000 text on #ffffff becomes harsh #ffffff on #000000 under inversion. Off-black and off-white, like #1c2333 on #f6f7fb, invert to something easier to read.
  • Do not rely on colour alone for meaning. A red "overdue" label can become a muddy colour after inversion. Pair it with a word.
  • Give buttons a border in a similar colour. If the client changes the button's background but not the page, the border keeps the edge visible.
  • Do not put important text over background images. Clients often leave images alone and change the text colour on top of them, so light text can land on a light photo.

Test the worst case

You cannot test every client's algorithm without the clients themselves. What you can do is test the harshest case, full inversion, and make sure nothing important disappears.

The email preview has a dark mode switch that applies a full inversion to your email, keeping photos as they are, the way the most aggressive clients behave. Look for:

  • logos that vanish,
  • text that loses contrast against its background,
  • buttons whose edges disappear,
  • images that clash with the inverted background.

Turn on Block images at the same time to check what readers see before they load images, which is the state many of them open your email in.

A short checklist

  • Declare color-scheme in the head.
  • Add a prefers-color-scheme: dark block for the clients that read it.
  • Put logos and dark icons on a solid background, or outline them.
  • Use off-black and off-white rather than pure black and white.
  • Give buttons borders.
  • Preview with full inversion before sending.

Emails built in the template builder declare a light colour scheme and use solid-colour buttons and backgrounds, so they behave predictably under inversion. If you add a dark palette by hand, continue in the HTML email editor and use its preview with dark mode switched on.

Written by

Full-stack engineer, builder and maintainer of the tools on this site. These guides cover the parts of email that break in production.

LinkedInGitHub