
Dark mode is no longer a "nice-to-have" feature; it is a user expectation. Whether it’s to reduce eye strain in low-light environments or to save battery life on OLED screens, users are flipping the switch. However, many designers and developers make the mistake of assuming that a dark mode implementation is a simple matter of inverting the color palette.
If you take your light-mode typography—meticulously kerned and weighted—and simply turn the text white on a black background, you’ll notice something strange: the text looks "fatter," more blurred, and harder to read. This is the phenomenon of the "Weight of Light."
The primary reason typography needs an overhaul in dark mode is an optical illusion known as halation. In a dark-on-light setting (traditional print style), the dark letters absorb the light from the background, keeping the edges crisp.
However, in a light-on-dark setting, the light from the characters "bleeds" into the surrounding dark space. This causes the white text to appear thicker than its dark counterpart, even if they share the exact same pixel width. To the human eye, light text on a dark background vibrates, creating a "glowing" effect that can make thin lines appear medium and medium lines appear bold.
To combat halation, the first step is to reduce the font weight of your body text. If you are using a font weight of 400 (Regular) for your light mode, you may find that a weight of 300 or 350 (Light/Book) provides a more equivalent visual experience in dark mode.
Variable fonts are a game-changer here. Instead of jumping between rigid weights like 400 and 700, variable fonts allow you to shave off just enough weight to compensate for the light bleed without making the text look too thin.
:root {
--font-weight-body: 450;
--text-color: #1a1a1a;
--bg-color: #ffffff;
}
@media (prefers-color-scheme: dark) {
:root {
/* Slightly lighter weight to compensate for halation */
--font-weight-body: 400;
--text-color: #e0e0e0;
--bg-color: #121212;
}
}
body {
font-variation-settings: 'wght' var(--font-weight-body);
color: var(--text-color);
background-color: var(--bg-color);
}
A common reflex is to use pure white (#FFFFFF) on a pure black (#000000) background. While this technically offers the highest contrast ratio, it is often painful for the user. High-contrast white-on-black causes "halation" to be at its most aggressive, leading to significant eye fatigue.
Instead, aim for an "off-white" or a very light gray (like #E0E0E0 or #F5F5F5) for your text, and a deep charcoal or navy for the background. This softens the edge of the characters and makes the reading experience much smoother over long periods.
Because light text appears to occupy more space, the characters can seem to "crowd" one another in dark mode. To improve legibility, you should consider slightly increasing the letter-spacing (tracking).
Even a small increase of 0.01em or 0.02em can provide the necessary breathing room to prevent the letters from blurring together in the user's peripheral vision.
/* Dark Mode specific typography tweaks */
@media (prefers-color-scheme: dark) {
body {
letter-spacing: 0.015em;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
}
When overhauling your typography for dark mode, always check your contrast ratios against WCAG 2.1 guidelines. While we want to reduce the "harshness" of the contrast, we must ensure that the text remains accessible to users with visual impairments.
A contrast ratio of at least 4.5:1 for body text is the standard. Interestingly, because of how our eyes perceive light, you might find that a ratio that looks "too low" in light mode actually feels perfectly legible in dark mode—but you should always stick to the mathematical standards to ensure universal access.
Designing for dark mode is an exercise in optical physics as much as it is in aesthetics. By acknowledging that light text carries more visual "weight" than dark text, you can make informed decisions about font weights, tracking, and color choice. Your users' eyes will thank you for the extra effort in creating a UI that isn't just a color swap, but a thoughtfully engineered reading experience.