
When switching a web app or website to dark mode, developers often take the most direct path: flip the background to black (#000000) and the text to white (#FFFFFF). But as soon as you look at the screen, something feels off. Paragraphs look chunkier, headings bleed into each other, and the text feels noticeably heavier than it did on a light background.
This isn't a browser bug or a rendering glitch. It is a fundamental optical illusion hardwired into human visual perception—and it requires a deliberate typographic approach to fix.
The reason dark mode text looks thicker is due to an optical phenomenon known as the Irradiation Illusion (first described by Hermann von Helmholtz in the 19th century).
When our eyes process bright light against a dark background, the illuminated area bleeds outward into the surrounding dark area on our retina. When light text sits on a dark background, this light "halo" makes letterforms appear bolder and closer together than they actually are.
Conversely, black text on a white background absorbs light around it, causing the letterforms to appear slightly thinner. If you use the exact same font-weight (e.g., 400) in both light and dark modes, your dark mode text will optically look like a 500 or 600 weight.
The problem becomes worse when using pure white (#FFFFFF) on pure black (#000000). This maximum-contrast combination triggers severe halation, causing visual fatigue, vibration artifacts, and eye strain for readers.
To create readable, elegant dark-mode typography, we need to balance light emission, perceived weight, and character spacing.
The most effective visual adjustment is reducing harsh contrast. Avoid pure black backgrounds and pure white body copy.
/* Avoid */
body.dark-mode {
background-color: #000000;
color: #ffffff;
}
/* Better */
body.dark-mode {
background-color: #121212;
color: rgba(255, 255, 255, 0.87);
}
By lowering body text opacity to around 87% (or using an off-white like #E0E0E0), you significantly diminish the light-bleed effect while maintaining WCAG AA/AAA accessibility standards.
If your design system utilizes Variable Fonts, you don't have to settle for standard weight jumps (e.g., from 400 to 300). You can dial back the font weight precisely in dark mode.
:root {
--font-weight-body: 400;
--bg-color: #ffffff;
--text-color: #1a1a1a;
}
@media (prefers-color-scheme: dark) {
:root {
/* Optically counter the irradiation effect */
--font-weight-body: 350;
--bg-color: #121212;
--text-color: rgba(255, 255, 255, 0.87);
}
}
body {
background-color: var(--bg-color);
color: var(--text-color);
font-weight: var(--font-weight-body);
}
Reducing the weight by just 30 to 50 units makes dark-mode body copy feel optically identical to its light-mode counterpart.
Because illuminated characters visually expand, the counter-spaces (the empty spaces inside and between letters) feel smaller. Adding micro-amounts of letter spacing gives the text breathing room.
.dark-mode p {
letter-spacing: 0.012em;
}
A slight nudge in letter-spacing prevents character collisions and keeps letterforms distinct.
On macOS and iOS devices, subpixel antialiasing can render light text on dark backgrounds unnaturally thick. You can smooth out the edges by enabling grayscale font smoothing specifically for dark themes.
.dark-mode {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
Here is a complete, production-ready pattern using CSS custom properties:
:root {
--color-bg: #f8f9fa;
--color-text: #212529;
--font-weight-regular: 400;
--font-weight-bold: 700;
--tracking-body: normal;
}
@media (prefers-color-scheme: dark) {
:root {
--color-bg: #121212;
--color-text: rgba(255, 255, 255, 0.88);
--font-weight-regular: 360; /* Adjusted for light bleed */
--font-weight-bold: 650;
--tracking-body: 0.015em;
}
}
body {
background-color: var(--color-bg);
color: var(--color-text);
font-weight: var(--font-weight-regular);
letter-spacing: var(--tracking-body);
transition: background-color 0.3s ease, color 0.3s ease;
}
strong, h1, h2, h3 {
font-weight: var(--font-weight-bold);
}
Typography is not purely mathematical; it is an optical discipline. What looks visually correct to human eyes rarely matches raw numerical properties when switching color schemes. By softening contrast, tuning variable font weights, and expanding letter spacing, you can eliminate the dark mode typographic trap and deliver a polished, comfortable reading experience.
Photo by Magda Ehlers on Pexels