Complete Guide to Email Dark Mode: Testing & Best Practices
Complete Guide to Email Dark Mode: Testing & Best Practices
Dark mode is no longer optional. Over 80% of users have dark mode enabled on at least one device. If your emails don't work in dark mode, you're losing engagement.
This guide covers everything you need to know about designing, coding, and testing dark mode emails.
How Dark Mode Affects Emails
Email clients handle dark mode in three different ways:
1. No Color Change
Some clients (like older Gmail) don't change email colors at all.
2. Partial Color Inversion
Light backgrounds become dark, but some colors are preserved.
3. Full Color Inversion
All colors are inverted automatically, often causing unintended results.
The Three Dark Mode Scenarios
Scenario 1: Gmail (Android/iOS)
Gmail partially inverts colors:
- White backgrounds → Dark gray
- Light text → Inverted
- Images → Unchanged (can cause visibility issues)
Scenario 2: Apple Mail
Apple Mail respects the @media (prefers-color-scheme: dark) CSS query:
- You have full control over dark mode styles
- Can specify exact colors for dark mode
Scenario 3: Outlook (Windows/Mac)
Outlook uses its own algorithm:
- Inverts colors unpredictably
- May make logos invisible
- Requires special handling
Best Practices for Dark Mode Emails
1. Use Transparent PNG Logos with Padding
Problem: Logos on transparent backgrounds disappear on dark backgrounds.
Solution: Add a subtle light background or use a logo with built-in padding:
<img
src="logo.png"
alt="Logo"
style="background-color: #ffffff; padding: 8px; border-radius: 4px;"
/>
2. Avoid Pure White (#FFFFFF) Backgrounds
Pure white becomes harsh dark gray. Use slightly off-white instead:
background-color: #F8F8F8; /* Softer transition to dark mode */
3. Use the CSS Color-Scheme Meta Tag
Tell email clients your email supports dark mode:
<meta name="color-scheme" content="light dark">
<meta name="supported-color-schemes" content="light dark">
<style>
:root {
color-scheme: light dark;
}
</style>
4. Write Dark Mode-Specific CSS
@media (prefers-color-scheme: dark) {
.email-body {
background-color: #1a1a1a !important;
color: #ffffff !important;
}
.header {
background-color: #2d2d2d !important;
}
.button {
background-color: #9E8FD3 !important;
}
}
5. Test Your Logo in Both Modes
Create two versions of your logo if needed:
- Light background version for dark mode
- Standard version for light mode
<!-- Light mode logo (hidden in dark mode) -->
<img src="logo-dark.png" class="light-mode-only" />
<!-- Dark mode logo (hidden in light mode) -->
<!--[if !mso]><!-->
<div class="dark-mode-only" style="display: none;">
<img src="logo-light.png" />
</div>
<!--<![endif]-->
6. Use High Contrast Colors
Ensure text remains readable:
- Light mode: Dark text on light backgrounds
- Dark mode: Light text on dark backgrounds
- Minimum contrast ratio: 4.5:1
7. Avoid Relying on Background Colors for Meaning
If you use color to convey information, add text or icons as backup.
Color Palette Recommendations
Safe Colors That Work in Both Modes
| Element | Light Mode | Dark Mode |
|---|---|---|
| Background | #F8F8F8 | #1a1a1a |
| Card | #FFFFFF | #2d2d2d |
| Primary Text | #333333 | #E0E0E0 |
| Secondary Text | #666666 | #A0A0A0 |
| Accent | #9E8FD3 | #9E8FD3 |
CSS Variables Approach
:root {
--bg-primary: #F8F8F8;
--text-primary: #333333;
--accent: #9E8FD3;
}
@media (prefers-color-scheme: dark) {
:root {
--bg-primary: #1a1a1a;
--text-primary: #E0E0E0;
--accent: #B8AAE0;
}
}
Testing Dark Mode Emails
Manual Testing
- Enable dark mode on your device
- Send a test email
- Check in each email client
Automated Testing
Use EmailTestLab to instantly toggle between light and dark mode previews across 6 email clients. Our Dark Mode Support test automatically checks:
- ✅ Color scheme media queries
- ✅ Logo visibility
- ✅ Text contrast in dark mode
- ✅ Background color handling
Common Dark Mode Mistakes
❌ Mistake 1: Using Images for Text
Images with text don't invert, creating contrast issues.
Fix: Use real HTML text with proper dark mode styles.
❌ Mistake 2: Forgetting About Borders
Light borders can become invisible on dark backgrounds.
Fix: Use colors that maintain contrast in both modes.
❌ Mistake 3: Not Testing Across Clients
Gmail, Outlook, and Apple Mail all handle dark mode differently.
Fix: Test in all major clients before sending.
Quick Checklist
Before sending your email in dark mode:
- Logo visible on both light and dark backgrounds
- Text contrast meets accessibility standards
-
@media (prefers-color-scheme: dark)CSS included - Meta tags for color-scheme added
- Tested in Gmail, Outlook, and Apple Mail
- No important information conveyed by color alone
Conclusion
Dark mode email design requires planning, but the payoff is worth it. Users appreciate emails that respect their preferences, and proper dark mode support can improve engagement.
Key takeaways:
- Use transparent logos with padding
- Write dark mode-specific CSS
- Test across multiple email clients
- Maintain high contrast for accessibility
Test your email's dark mode instantly with EmailTestLab - free dark mode preview across 6 email clients.
EmailTestLab Team
Helping you send better emails with comprehensive testing and validation.