How to Make Emails Work in Dark Mode?
Quick Answer
Make emails work in dark mode by using real text instead of text in images, avoiding text on background images, preparing both light and dark logo versions, using dark mode media queries for Apple Mail, choosing midtone colors, and testing in the actual Gmail app on iOS and Android.
How to Make Emails Work in Dark Mode?
Make emails work in dark mode by using real text instead of text in images, avoiding text on background images, preparing both light and dark logo versions, using dark mode media queries for Apple Mail, choosing midtone colors, and testing in the actual Gmail app on iOS and Android.
Quick Answer
Make emails work in dark mode by using real text instead of text in images, avoiding text on background images, preparing both light and dark logo versions, using dark mode media queries for Apple Mail, choosing midtone colors that invert gracefully, and testing in the actual Gmail app on iOS and Android.
Step-by-Step: Making Emails Work in Dark Mode
Step 1: Use Real Text Instead of Text in Images
Why it matters: Text baked into images never inverts, creating rigidity and accessibility problems. Real text inverts with Gmail's system.
How to do it:
- Write text in HTML, not in image files
- Use web fonts for styled text
- Avoid image buttons with text
- Use CSS for text styling
Example:
❌ Poor: <img src="headline.png" alt="Special Offer">
✅ Good: <h1 style="font-size: 24px; color: #333333;">Special Offer</h1>
Step 2: Avoid Text on Background Images
Why it matters: Gmail inverts the background color behind an image, not the image itself, making contrast unpredictable.
How to do it:
- Don't overlay text directly on background images
- Use solid color backgrounds for text areas
- Add semi-transparent overlays if you must use background images
- Test contrast in both light and dark mode
Example:
❌ Poor: Text directly on background image
✅ Good: Text on solid color background, image as decorative element
Step 3: Prepare Both Light and Dark Logo Versions
Why it matters: Some logos cannot survive inversion without alternatives. Transparent logos vanish on dark backgrounds.
How to do it:
- Create light version for dark backgrounds
- Create dark version for light backgrounds
- Use CSS to switch based on dark mode (for Apple Mail)
- For Gmail, choose a logo that works in both modes
Example:
/* For Apple Mail */
@media (prefers-color-scheme: dark) {
.logo { content: url('logo-light.png'); }
}
.logo { content: url('logo-dark.png'); }
Step 4: Use Dark Mode Media Query for Apple Mail
Why it matters: Apple Mail supports dark mode media queries, allowing you to provide custom dark mode styling for a large share of your audience.
How to do it:
- Add
@media (prefers-color-scheme: dark)styles - Define dark backgrounds and light text
- This won't affect Gmail, but improves Apple Mail experience
Example:
@media (prefers-color-scheme: dark) {
body {
background-color: #121212;
color: #ffffff;
}
.button {
background-color: #ffffff;
color: #121212;
}
}
Step 5: Choose Midtone Colors
Why it matters: Extreme light or dark values shift too far during inversion. Midtone colors move less dramatically.
How to do it:
- Avoid pure white (#FFFFFF) and pure black (#000000)
- Use midtone grays and colors
- Test how colors look when inverted
- Choose colors that work in both light and dark mode
Example:
- ❌ Poor: Pure white (#FFFFFF) or pure black (#000000)
- ✅ Good: Midtone gray (#666666) or medium blue (#4A90E2)
Step 6: Test with Email Testing Tools and in the Actual Gmail App
Why it matters: Gmail behaves differently across devices. There's no shortcut—you must test in the actual apps.
How to do it:
- Use email testing tools like MailMoxie to identify dark mode and accessibility issues with clear recommendations on what to fix and how to fix it
- Send test emails to Gmail accounts
- Test on iOS Gmail app
- Test on Android Gmail app
- Switch between light and dark mode
- Fix issues you discover
What to check:
- Background colors invert correctly
- Text remains readable
- Logos are visible
- Buttons work properly
- Overall appearance is acceptable
Additional Tips
Use Semantic HTML
Why it helps:
- Semantic HTML works better with dark mode
- Proper structure helps with inversion
- Screen readers benefit too
Avoid Fixed Color Values
When possible:
- Use relative colors
- Avoid hard-coded hex values
- Consider CSS variables (limited email support)
Design for Both Modes
Think ahead:
- Design with dark mode in mind from the start
- Test early and often
- Accept that Gmail will invert colors
Quick Checklist
✅ Text: Use real HTML text, not text in images
✅ Backgrounds: Avoid text on background images
✅ Logos: Prepare light and dark versions
✅ Media queries: Use for Apple Mail support
✅ Colors: Choose midtone colors that invert gracefully
✅ Testing: Test in Gmail apps on iOS and Android
✅ Contrast: Ensure text remains readable after inversion
Common Questions
Q: Can I prevent Gmail from inverting my email?
A: No, you cannot prevent Gmail from inverting colors on mobile apps. You must design your email to work with inversion in mind.
Q: Do I need to create separate email versions for dark mode?
A: For Gmail mobile, no—you cannot provide a separate version since media queries are ignored. For Apple Mail, you can use media queries to provide custom styling.
Q: What colors work best for dark mode?
A: Midtone colors work best because they don't shift as dramatically when inverted. Avoid extreme light or dark values.
Q: How do I test dark mode in Gmail?
A: Use email testing tools like MailMoxie to identify potential dark mode issues with clear recommendations on what to fix and how to fix it. Then send test emails to Gmail accounts and view them in the Gmail app on iOS and Android. Switch between light and dark mode to see how your email looks.
Q: Will my email look the same in all email clients?
A: No, each client handles dark mode differently. Gmail inverts colors, Apple Mail supports media queries, and Outlook has its own approach. Test in multiple clients.
Q: Can I use CSS to fix dark mode issues?
A: Limited options for Gmail mobile since it ignores media queries. You can use media queries for Apple Mail and design with inversion in mind for Gmail.
Q: What if my logo disappears in dark mode?
A: Create a light version of your logo for dark backgrounds. For Apple Mail, use media queries to switch logos. For Gmail, choose a logo that works in both modes.
Q: How important is dark mode testing?
A: Very important. Many users use dark mode, and broken emails hurt engagement and brand perception. Always test in the actual Gmail apps.
Key Takeaways
- Use real HTML text instead of text in images—text in images never inverts
- Avoid text on background images—Gmail inverts backgrounds but not images, making contrast unpredictable
- Prepare both light and dark logo versions—some logos can't survive inversion
- Use dark mode media queries for Apple Mail—improves experience for a large share of your audience
- Choose midtone colors—extreme light or dark values shift too far during inversion
- Use email testing tools like MailMoxie to identify dark mode and accessibility issues with clear recommendations on what to fix and how to fix it
- Test in actual Gmail apps—there's no shortcut, you must test on iOS and Android
- Design with dark mode in mind from the start—it's easier than fixing later
- Accept that Gmail will invert colors—design to survive inversion rather than fighting it