Read Time: 20 min

The Ultimate Guide to Dark Mode for Email Marketers

Categories

Dark Mode. The tech industry is buzzing with these two words, and email marketing is no exception. In 2018, Apple added Dark Mode to its desktop email client. The following year, Dark Mode came to iOS Mail and other industry heavyweights, including Gmail, announced support for Dark Mode. There’s no denying Dark Mode is taking over the inbox—and making sure emails look great in this reading environment is the new big challenge for email marketers.

Dark Mode is taking over the inbox—and making sure emails look great in this reading environment is the new big challenge for email marketers. Tweet this →

In this post, we break down:

Ready to dive in? Let’s recap the basics first.

What is Dark Mode? A darker color palette for low-light or nighttime environments

Dark Mode is a reversed color scheme that uses light-colored typography, UI elements, and iconography on dark backgrounds—and it’s one of the hottest digital design trends in recent years. From Apple’s OS to apps like Twitter, Slack, or Facebook Messenger, most popular operating systems and apps now allow users to switch to Dark Mode.

Dark Mode is a hot topic—and for good reason. Many people prefer Dark Mode because:

  • It’s easier on the eyes. Light text on a dark background is much better for minimizing eye strain, especially in low-light situations.
  • It reduces screen brightness, saving your battery life.
  • It can improve content legibility and can make it easier for some users to consume content on desktop and mobile.
  • They may simply have a preference for darker interfaces.

With Dark Mode popularity growing, it’s no surprise that it’s coming to the inbox, too.

Free Guide

Learn even more on Dark Mode. Fill out the form to download now.

How are clients applying Dark Mode to my emails?

At the moment, there appear to be three fundamentally different types of color schemes that email clients use to apply Dark Mode to emails. Let’s look at them one by one (or jump straight to the Dark Mode Email Client Support Chart).

No color changes

Yes, you read right. Some email clients let you change their UI to Dark Mode, but that doesn’t have any impact on how your HTML email is rendered. Whether the app is set to Light or Dark Mode, your email will look exactly the same. Certain email clients will always render your Light Mode designs by default (unless you specifically add code to trigger Dark Mode, which I’ll discuss later). Here’s a list of those clients:

  • Apple Mail
  • iPhone
  • iPad
  • Hey.com

Check out this email example in Apple Mail: The design of the email stays exactly the same, no matter if you view it in the dark or light email client UI:

There are a few exceptions though: First, plain text emails do trigger the application of a Dark Mode theme, and the minimum code that blocks Dark Mode from applying to a plain text email is a 2×1 image—this is to ensure that you can include a 1×1 tracking pixel while retaining a “plain text” feel.

Secondly, if you accidentally leave Dark Mode <meta> tags in your template, Apple Mail / iPhone / iPad will auto-convert any instance of pure white #ffffff to dark gray unless you override it with your custom Dark Mode styles. Or alternatively, you can use an off-white like #fffffe instead.

Dark Mode options: default vs. custom

There are quite a few email clients that will automatically force their default Dark Mode onto your email if you don’t do anything at all. But if you’re like most of us and you’re not a fan of these Default styles, you might want to go with the third option: design and code your own Dark Mode theme. Below, you can see a side-by-side of an email with a Light Mode theme, and a Custom Dark Mode theme.

Litmus light mode email vs. custom dark mode email example

Before we look into how to approach a custom Dark Mode theme though, let’s check out how other email clients treat their Default Dark Modes.

Default Dark Modes: partial color invert

The first Dark Mode theme is what I like to call a “Partial Color Invert”. It only detects areas with light backgrounds and inverts them so the light backgrounds are dark, while the dark text becomes light.

It generally leaves areas that already have dark backgrounds alone, resulting in a fully Dark Mode design. Fortunately, most email clients that use this method also support Dark Mode targeting, so you can override the client-default dark theme.

Outlook.com is an email client that partially inverts colors, like you can see in this screenshot:

email side-by-side comparison

Default Dark Modes: full color invert

The Full Color Invert is the most invasive color scheme: It not only inverts the areas with light backgrounds, but impacts dark backgrounds as well.

So if you already designed your emails to have a dark theme, this scheme will ironically force them to become light. Unfortunately, this is currently the tactic used by some of the more popular email clients, such as Gmail app (iOS) and Outlook 2019 (Windows).

In the examples below, you can see the light backgrounds have been converted to dark versions of the original colors and areas that previously had a dark background with light text are now light with dark text.

side-by-side email example

Not only does this Full Color Invert scheme most radically change your email, but the email clients that use this logic also don’t allow Dark Mode targeting at the moment.

Email clients are still figuring out how to best implement Dark Mode and may be open to feedback from users—especially since not allowing developers to target Dark Mode with their own styles can have a negative impact on legibility and accessibility.

In the interest of advocating for better Dark Mode targeting support and less invasive Dark Mode theming logic, you can communicate your thoughts directly to Gmail’s Accessibility team, and you can also contribute your screenshots of Gmail’s Dark Mode breaking your email.

How do I target Dark Mode users with my own styles?

As noted above, how email clients in Dark Mode handle your regular HTML emails will vary. But what if you’d like to apply your own Dark Mode styles that could very well differ from email clients’ default color schemes? There are two methods you can use.

@media (prefers-color-scheme: dark)

This method works in very much the same way as applying a block of styles inside a @media query for your Mobile Responsive view, except this CSS block targets any user interface that’s set to Dark Mode. @media (prefers-color-scheme: dark) allows you to create the most robust custom Dark Mode themes where you can implement anything from Dark Mode-specific image swaps, hover effects, background images… basically almost anything you can do with traditional CSS!

[data-ogsc]

This is a method first brought to our attention by Mark Robbins to target the Outlook app. While it seems like a pretty narrow market share, it’s relatively easy to simply duplicate the @media (prefers-color-scheme: dark) styles you already applied and simply add the appropriate [data-ogsc] prefixes to each CSS rule.

 

Which email clients support Dark Mode?

These clients and apps currently offer Dark Mode—either as a setting that the user can set manually or by automatically detecting the user’s preferred color scheme:

Mobile Apps

Desktop Clients

Web Clients

But just because all these email clients offer a way to set their UI to a dark color scheme, that doesn’t mean that they handle your emails the same way. Email rendering is complex. An email that looks great in one client might look broken in another. Now, Dark Mode is adding another layer of complexity. As we’ve already shown, there are various ways a Dark Mode email client might deal with your code.

And there’s no consistent support for the different targeting methods either. So which email client follows which color scheme by default? While some offer email designers no opportunities to target Dark Mode to optimize the reading experience, most clients can be targeted with either the @media (prefers-color-scheme: dark) or [data-ogsc] methods.

We’ve tested the Dark Mode settings in the following email clients to see how they impact a regular email that doesn’t include any Dark Mode-specific targeting as well as support for targeting Dark Mode. Here’s what we found…

Dark Mode email client support chart (as of October 2021)

Email Client

HTML Treatment in Dark Mode

@media

[data‐ogsc]

Quirks

Apple Mail (MacOS)

No change*

✓ Yes

✘ No

*Pure white (#ffffff) BGs will be inverted if <meta> is present

iPhone / iPad (iOS 13)

No change*

✓ Yes

✘ No

*Pure white (#ffffff) BGs will be inverted if <meta> is present

Hey.com

No change

✓ Yes

✘ No

Outlook.com

Partial invert

? Partial*

? Partial**

*Some BG colors will be darkened
**Image swap works!

Outlook 2019 (MacOS)

Partial invert

? Partial*

✘ No

*Some BG colors will be darkened

Outlook 2019 (WinOS)

Full invert*

✘ No

✘ No

*Special targeting is possible!

Outlook app (iOS)

Partial invert

? Partial*

✘ No

*Some BG colors will be darkened

Outlook app (Android)

Partial invert

✘ No

? Partial*

*Some BG colors will be darkened

Gmail app (iOS)

Full invert*

✘ No

✘ No

*Special targeting is possible!

Gmail app (Android)

Partial invert

✘ No

✘ No

 

Gmail iOS & Outlook Windows-Specific Targeting

Since I originally wrote this guide, some of my favorite #EmailGeeks out there have developed brilliant workarounds to control some of the Full Invert Default Themes we’ve been battling with. Each of these solutions are so thorough, they warrant their own guides—so be sure to check them out for a full explanation!

Rémi Parmentier came up with a tutorial on “Fixing Gmail’s dark mode issues with CSS Blend Modes” by combining mix-blend-mode and the Gmail hack from HowToTarget.email to retain your original background and text colors for Gmail App iOS.

Nicole Merlin put her email wizardy to work in “How To Fix Outlook Dark Mode Problems”, crafting two methods to target Outlook for Windows’ Dark Mode with MSO-specific gradient CSS properties and a really neat VML (Vector Markup Language) trick.

A word of caution when delving into these hacks, however: Because both of these methods have the intended effect of forcing the email client to render the original Light Mode text and/or background colors where applied, you run the risk of disrespecting your users’ preference for Dark Mode which goes against the spirit of accessibility. Make sure to use these sparingly, like improving the contrast ratio when the backgrounds or text convert to Dark Mode in an unreadable manner.

Though these targeting methods are relatively limited in comparison to what you can do with the @media (prefers-color-scheme: dark) or [data-ogsc] methods, they’re still handy tools to have in case you need to fix problems with Dark Mode breaking your text legibility.

How to design and code Dark Mode emails

When targeting Dark Mode styles across email clients, be sure to follow each of these six steps to improve the Dark Mode experience for your subscribers.

1. Optimize your logos and other images for all styles

Add a translucent outline to transparent PNGs with dark text for legibility in email clients where Dark Mode customization is more limited, like Gmail App and Outlook 2019 (Windows).

This will help prevent any issues where the email client might decide to use either the Partial Color Invert or Full Color Invert settings—and make things easier on the eyes for your subscribers. Opting for transparent backgrounds wherever possible will help with this.

01-logos

You can even have fun with a Dark Mode-optimized logo!

Below is an example of a fake logo I made where I not only added a light drop-shadow behind the text to make it stand out against dark backgrounds, but I also incorporated a starry texture behind it to suit the “NebulaCo” galaxy theme.

Any light translucent element that you build into your logo will be invisible on Light Mode, serve as a defensive design tactic, and offers the opportunity to add a special branding touch that can only be seen in Dark Mode.

If your images are not transparent and include backgrounds, make sure there is enough padding around your focal point to avoid an awkward juxtaposition.

03-whitespace

Plus, swap Light Mode and Dark Mode images with the @media (prefers-color-scheme: dark) and [data-ogsc] methods described below in this guide.

2. Enable Dark Mode in email client user agents

By including this metadata in your <head> tag, you can ensure that Dark Mode is enabled in your email for subscribers that have Dark Mode turned on:

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

3. Add Dark Mode styles for @media (prefers-color-scheme: dark)

Add this media query in your embedded <style></style> section for custom dark mode styles in iOS, Apple Mail, Outlook.com, Outlook 2019 (MacOS), and Outlook App (iOS).

The .dark-img and .light-img classes are particularly useful for showing a dark mode-specific logo if having an outlined logo isn’t ideal.

Example CSS:

@media (prefers-color-scheme: dark ) {
  /* Shows Dark Mode-Only Content, Like Images */
  .dark-img { display:block !important; width: auto !important; overflow: visible !important; float: none !important; max-height:inherit !important; max-width:inherit !important; line-height: auto !important; margin-top:0px !important; visibility:inherit !important; }
  
  /* Hides Light Mode-Only Content, Like Images */
  .light-img { display:none; display:none !important; }
  
  /* Custom Dark Mode Background Color */
  .darkmode { background-color: #272623 !important; }
  
  /* Custom Dark Mode Font Colors */
  h1, h2, p, span, a, b { color: #ffffff !important; }
  
  /* Custom Dark Mode Text Link Color */
  .link { color: #91ADD4 !important; }
}

4. Duplicate Dark Mode styles with [data-ogsc] prefix

Add this styling for support in Outlook app (Android).

Example CSS:

/* Shows Dark Mode-Only Content, Like Images */
[data-ogsc] .dark-img { display:block !important; width: auto !important; overflow: visible !important; float: none !important; max-height:inherit !important; max-width:inherit !important; line-height: auto !important; margin-top:0px !important; visibility:inherit !important; }

/* Hides Light Mode-Only Content, Like Images */
[data-ogsc] .light-img { display:none; display:none !important; }

/* Custom Dark Mode Background Color */
[data-ogsc] .darkmode { background-color: #272623 !important; }

/* Custom Dark Mode Font Colors */
[data-ogsc] h1, [data-ogsc] h2, [data-ogsc] p, [data-ogsc] span, [data-ogsc] a, [data-ogsc] b { color: #ffffff !important; }

/* Custom Dark Mode Text Link Color */
[data-ogsc] .link { color: #91ADD4 !important; }

5. Apply your Dark Mode-only styles to your body HTML

Make sure all of your HTML tags have the appropriate Dark Mode classes inserted. Here is an example of the .dark-img and .light-img classes as they appear in our Light Mode vs. Dark Mode logos.

Example HTML:

<!-- start HEADER_LOGO -->
<a href="http://litmus.com/" target="_blank">

    <img class="light-img" src="https://campaigns.litmus.com/_email/_global/images/logo_icon-name-black.png" width="163" height="60" alt="Litmus" style="color: #33373E; font-family:'proxima_nova', Helvetica, Arial, sans-serif; text-align:center; font-weight:bold; font-size:36px; line-height:40px; text-decoration: none; margin: 0 auto; padding: 0;" border="0" />

    <!-- The following Dark Mode logo image is hidden 
    with MSO conditional code and inline CSS, but will be         
    revealed once Dark Mode is triggered -->

    <!--[if !mso]><! --><div class="dark-img" style="display:none; overflow:hidden; float:left; width:0px; max-height:0px; max-width:0px; line-height:0px; visibility:hidden;" align="center">
          <img src="https://campaigns.litmus.com/_email/_global/images/logo_icon-name-white.png" width="163" height="60" alt="Litmus" style="color: #ffffff; font-family:'proxima_nova', Helvetica, Arial, sans-serif; text-align:center; font-weight:bold; font-size:36px; line-height:40px; text-decoration: none; margin: 0 auto; padding: 0;" border="0" />
    </div><!--<![endif]-->

</a>
<!-- end HEADER_LOGO -->

6. ABT: Always Be Testing!

As we always mention, email clients are constantly changing. Especially with a new feature like Dark Mode, tweaks to rendering logic are coming quickly and frequently. The only way to be on top of it all is to test every email with a tool like Litmus.

QA test your Dark Mode emails

Did you do it right? Find out with a free trial of Litmus. Preview how your emails look in over 100 email clients, apps, and devices. And ensure your emails are on brand and error-free, every time.

START FREE TRIAL

 

Respect user preferences when it comes to Dark Mode

One of the biggest benefits of Dark Mode is its assistance with reducing eye strain for people in low-light conditions or for other personal reasons. But it’s not a matter of Dark Mode vs. Light Mode. It’s a matter of what your subscribers want—whether that’s a dark or a light experience. There’s no right or wrong answer.

So, if your subscribers are making the conscious decision to view emails in Dark Mode, it’s best to respect that. Just like you’d want to add ALT text in case your subscribers prefer to have images off by default, you should build emails that respect darker interfaces, too.

Originally published on November 20, 2019, by Alice Li. Last updated October 28, 2021.