Dark mode email preview

Mail apps don’t ask before recoloring your message in dark mode, and they don’t agree with each other on how to do it. Paste your HTML to see the three behaviors side by side and find what becomes hard to read.

Getting the HTML: Mailchimp, Brevo, Constant Contact and similar services offer “Export as HTML” or “View code”. For a signature, press “Copy the HTML code” in our signature builder. In Gmail, open a received message and choose “Show original” to see its source.

Your code stays in this browser and is not uploaded. The previews run in sandboxed frames with scripts off. Images are fetched from their own URLs, the way a mail app would.

Three behaviors, not one dark mode

On a website, you decide what dark mode looks like. In email, the reading program decides for you, and each family of programs has its own way of going about it.

BehaviorTypical appsWhat it does
No changeApple Mail, Outlook for Mac, Gmail in a browserYour colors stay. The window around the message is dark, and the message itself only changes if it brings its own dark styles.
Partial inversionOutlook.com, Outlook and Gmail on Android, Outlook on iPhoneLight backgrounds are darkened and dark text is lightened. Areas that were already dark are left alone.
Full inversionGmail on iPhone, classic Outlook for WindowsEvery color is flipped, including dark backgrounds, which turn light.

So one message has four looks, the light original plus these three. The page shows all four at desktop or phone width.

How the previews are produced

The tool rewrites every color it finds in your HTML, whether it sits in an inline style attribute, in a <style> block or in an old attribute such as bgcolor. Each color is converted to hue, saturation and lightness. The hue stays and the lightness changes.

  • Partial inversion: a background with a relative luminance above 0.35 becomes dark. Text and borders in the darker half of the scale become light. Everything else is left as it is.
  • Full inversion: lightness is mirrored for every color, so white becomes near-black and black becomes near-white.
  • No change: nothing is rewritten. If the message declares color-scheme with dark, its @media (prefers-color-scheme: dark) rules are switched on. A message that sets no colors at all gets the app’s default dark canvas.

Rules written for Outlook.com with the [data-ogsc] and [data-ogsb] selectors are applied in the partial preview. Each preview runs in a sandboxed frame where scripts can’t execute.

What the findings mean

Not enough contrast
In each version, the tool pairs every piece of visible text with the nearest background behind it and computes the contrast ratio. Pairs under 4.5:1 are listed, worst first. Under 3:1 the mode is marked as an error. Hidden preheader text is skipped.
Medium gray text
A gray with little saturation and a lightness between 45 and 70 percent sits in the middle of the scale. Invert it and you get almost the same gray, only now on the opposite background. Use #555555 or darker for secondary text.
Dark logo on a transparent background
The tool loads up to 15 images and inspects their pixels. When most opaque pixels are very dark and the edges are transparent, the logo is going to melt into a dark background. An image on an opaque white background gets reported too, because it will show as a white box.
Transparency to check
The image’s server didn’t allow another site to read its pixels. You’ll have to look at the dark previews yourself.
Dark mode settings
Says whether the message declares support for dark mode and whether it supplies dark colors. Declaring support without supplying colors is worse than declaring nothing.
Images and text
A message with under 120 characters of real text is mostly pictures, and text inside pictures never adapts. Missing alt attributes are counted.

Fixes that survive every app

Start with the choices that need no code. Use strong pairs, meaning very dark text on very light backgrounds or the reverse, since mid-tones are what inversion ruins. Give a dark logo a white outline two or three pixels thick, or place it on a white rounded shape inside the image file. Keep words as HTML text.

For a newsletter, you can then add your own dark styles for the apps that honor them:

<meta name="color-scheme" content="light dark">
<style>
  :root { color-scheme: light dark; }
  @media (prefers-color-scheme: dark) {
    .card { background-color: #1e1e1e !important; }
    .body-text { color: #f2f2f2 !important; }
  }
</style>

A signature doesn’t get that option. The editor where you paste it strips out <meta> and <style>, which leaves you with clear colors and a logo that works on both backgrounds. Our email signature builder can send its result straight to this page.

This is a simulation built from observed behavior. The real recoloring rules aren’t published and they change with app updates. Take a clean result as a good sign, then send a test message to a phone and a computer set to dark mode.

Questions people ask

Why does my email look different in dark mode?

The reader’s mail app changed your colors. Some apps darken light backgrounds and lighten dark text, some flip every color, and some change nothing. What you get depends on the app, not on your design.

Can I stop Gmail from inverting my email colors?

No. Gmail gives senders no switch to opt out, and its mobile apps ignore dark-mode media queries. What you can do is design a message that stays readable once inverted, with strong contrast, no medium grays and a logo with a light outline.

Why did my logo disappear in dark mode?

It’s probably a dark logo saved with a transparent background. The app replaced the white behind it with near-black, and nobody can see dark on dark. Add a white outline or a white plate to the image, or supply a light version for dark mode.

Which mail apps support prefers-color-scheme?

Apple Mail on Mac, iPhone and iPad, and Outlook for Mac apply it. Gmail and Outlook for Windows don’t, and Outlook.com uses its own [data-ogsc] selectors. Your dark styles will improve things for some readers. They won’t cover everyone.

What does the color-scheme meta tag do in an email?

<meta name="color-scheme" content="light dark"> tells the app that the message handles both modes itself. Apps that respect it then use your dark styles. Only add it together with a prefers-color-scheme block that sets the dark colors.

Is the HTML I paste uploaded?

No. The color rewriting and the checks run in your browser. Only the images your HTML refers to are requested, from their own addresses, the way any mail app would fetch them.