Email Rendering Guide

Dark Mode in HTML Email: The Definitive 2026 Guide

Over 40% of smartphone and desktop users now read email in Dark Mode. Learn how different email clients invert colors, how to target media queries, and how to prevent broken logos and illegible text.

The 3 Types of Dark Mode Inversion

Not all dark mode clients behave equally. Understanding the three distinct inversion models is critical to building resilient campaigns:

1. No Inversion

Apple Mail (iOS & macOS)

Leaves your default colors untouched unless you explicitly declare dark mode styles using CSS media queries. Gives developers 100% control.

2. Partial Inversion

Outlook.com & Gmail iOS

Detects light backgrounds and turns them dark; turns dark text light. Leaves areas that are already dark mostly untouched.

3. Full Inversion

Outlook Windows & Gmail Android

Aggressively re-maps your entire color palette, converting dark containers into light ones and vice-versa, frequently breaking brand schemes.

Step 1: Declare Supported Color Schemes in <head>

Without the correct meta tags, modern clients like Apple Mail and Outlook app assume your email only supports light mode and will apply brute-force color filters. Add these two meta declarations inside your email’s <head>:

<meta name="color-scheme" content="light dark">
<meta name="supported-color-schemes" content="light dark">

Step 2: Dual Targeting with Media Queries & Outlook.com Selectors

To support both standards-compliant clients (Apple Mail) and webmail platforms (Outlook.com), write your CSS rules using this paired pattern:

<style type="text/css">
  :root {
    color-scheme: light dark;
    supported-color-schemes: light dark;
  }

  /* 1. Standard Dark Mode Media Query (Apple Mail, iOS) */
  @media (prefers-color-scheme: dark) {
    .dark-bg { background-color: #1a202c !important; }
    .dark-text { color: #f7fafc !important; }
    .dark-card { background-color: #2d3748 !important; }
    .dark-img { display: block !important; }
    .light-img { display: none !important; }
  }

  /* 2. Outlook.com Webmail Custom Attribute Targeting */
  [data-ogsc] .dark-bg { background-color: #1a202c !important; }
  [data-ogsc] .dark-text { color: #f7fafc !important; }
  [data-ogsc] .dark-card { background-color: #2d3748 !important; }
  [data-ogsc] .dark-img { display: block !important; }
  [data-ogsc] .light-img { display: none !important; }
</style>

Bulletproof Logo Techniques for Dark Backgrounds

One of the most common dark mode failures is a black logo disappearing against an inverted dark background. Here are the two proven solutions:

Method A: The Translucent Stroke (Recommended)

Export your logo as a transparent PNG with a subtle 2px to 3px translucent white (#FFFFFF at 25% opacity) outer stroke. In light mode, the white stroke is completely invisible against white cards; in dark mode, it outlines your logo mark with crisp clarity.

Method B: Dual-Image Toggling

Include both light and dark logo images in your markup, then use CSS display classes (.dark-img and .light-img) to switch visibility when dark mode is activated.

Dark Mode Frequently Asked Questions

Why do my dark logos disappear in dark mode emails?

If your logo is a transparent PNG with black or dark text, dark mode email clients that invert background colors to dark gray (#121212) will cause your dark logo to become invisible. Fix this by adding a subtle 2px translucent white stroke around your logo mark or by utilizing CSS dual-image toggling.

Does Gmail on Android support @media (prefers-color-scheme: dark)?

No. Gmail for Android applies an aggressive, non-standard full color inversion algorithm and does not respect @media (prefers-color-scheme: dark) queries. You must design with high-contrast colors and test how Gmail re-maps your HEX codes.

What are [data-ogsc] and [data-ogsb] selectors?

Outlook.com (webmail) strips standard CSS media queries in dark mode but automatically injects custom data attributes: data-ogsc (Outlook Global Style Color) and data-ogsb (Outlook Global Style Background). Prefixing your dark mode styles with these attributes forces Outlook.com to apply your custom colors.

Test Your Templates Instantly

I WANT EMAILER lets you preview and export clean HTML ready for modern dark mode reading.

Start Building Free