Dark Mode
Preview your email in dark mode.
View your email in light mode or dark mode in the Preview. This should not be confused with light/dark mode themes in the editor.
Change the Preview light/dark mode via the color scheme menu above the preview. You can choose between Light, Dark, Forced Dark or System, which matches your computer's configuration.
Dark/light mode affects prefers-color-scheme: dark/light
. You can easily identify the current mode by the Preview controls menu icon, which will be blue if any control is applied. Dark mode can be applied to any Browser preview.
(Sample code from Mozilla and Chris Ruppel)
<html>
<body>
<style>
.day {
background: #eee;
color: black;
}
.night {
background: #333;
color: white;
}
@media (prefers-color-scheme: dark) {
.day.dark-scheme {
background: #333;
color: white;
}
.night.dark-scheme {
background: black;
color: #ddd;
}
}
@media (prefers-color-scheme: light) {
.day.light-scheme {
background: white;
color: #555;
}
.night.light-scheme {
background: #eee;
color: black;
}
}
.day,
.night {
display: inline-block;
padding: 1em;
width: 7em;
height: 2em;
vertical-align: middle;
}
</style>
<div class="day">Day (initial)</div>
<div class="day light-scheme">Day (changes in light scheme)</div>
<div class="day dark-scheme">Day (changes in dark scheme)</div>
<br />
<div class="night">Night (initial)</div>
<div class="night light-scheme">Night (changes in light scheme)</div>
<div class="night dark-scheme">Night (changes in dark scheme)</div>
<picture>
<source
srcset="https://assets.chrisruppel.com/img/blog/picture-mq-dark.jpg"
media="(prefers-color-scheme: dark)"
/>
<img
src="https://assets.chrisruppel.com/img/blog/picture-mq-original.jpg"
alt="balcony"
width="300"
/>
</picture>
</body>
</html>
Forced dark mode emulates the color inversion that email clients will do. Some email clients - including Outlook and Gmail - will find areas of your email with dark text and light background and flip them to match the user's Dark Mode preference. While we don't have full control over these cases, being aware and testing your images and colors is a good idea.