Any website can now follow the dark setting of the device it is read on. Switching that on is easy. Getting it right is not, because a dark mode is a second design, not a filter over the first.
October 2026
Safari and WebKit do not auto-darken web content.
Timothy Hatcher, WebKit, 2019
This site has a dark mode, and a switch for it. On the some pages the dark version was mostly a matter of colours. The homepage had to be designed a second time, because a site that looks wrong in one of its two modes is worse than a site with only one.
This is note about why that happens, about the question that comes right after it, whether a site should have a day/night switch, and about why and how this website does it.
Where it came from
Dark screens are older than light ones: the first terminals showed green or amber text on black. Light pages came with the graphical interface, which imitated paper. Dark mode, as a setting you choose, came back in June 2018, when Apple announced macOS Mojave with a dark appearance for the whole system. Phones followed in 2019.
The web got its part in the same year. A small piece of CSS, the prefers-color-scheme media query, lets a page ask the browser whether the reader has chosen light or dark, and change its colours to match. Safari supported it first, with version 12.1 in the spring of 2019. Firefox 67 followed in May, Chrome 76 in July. Since then every current browser passes the reader’s choice on to every site.
Why inverting is not enough
The browser does not darken a page by itself; the designer has to say what dark means for this site. The obvious answer, swapping black and white, rarely works. Pure white text on pure black glares. Colours that look calm on a light background turn heavy or dull on a dark one, so every accent colour has to be chosen again, lighter and softer, and checked again for contrast. Shadows no longer work as shadows. Photos, logos and illustrations made for a light page can suddenly sit in a bright box, or disappear into the dark.
That last part is where the real work is. Text, links and plain panels translate well: on the notes pages the same greens, made lighter, read easily and still feel like this site. A page with more character, with large shapes and drawn images, does not translate. It has to be designed a second time, and it is only finished when both versions are as good as each other.
Follow the device, or add a switch?
Once a site has a dark mode, there are two ways to offer it. It can simply follow the setting of the device, or it can add a switch, the little sun and moon in the corner of the page.
Following the device is the quiet choice. The reader has already answered the question once, for every app and every site, and the browser passes the answer on. Nothing has to be clicked, stored or explained.
A switch earns its place in a few cases. Some people keep their computer dark but read long texts more easily on light, or the other way round. Some never change their system setting at all, and want a dark page just now, late in the evening. A switch lets a designer show both versions to a client in one click. But it is one more control on every page, it has to remember the choice, which needs a script and stored data, and it has to work with a keyboard and a screen reader. And most visitors never touch it.
How this site does it
The night version follows your device. If your computer or phone is set to dark, this site is dark from the first moment, without a flash of the light page first: a few lines of script at the top of every page make the choice before anything is drawn.
The switch sits in the header, to the right of the button: a moon by day, to make the page dark, and a sun at night, to make it light again. It is one button, not two, and it tells a screen reader whether dark mode is on. Without JavaScript the switch does not appear and the site stays light, because a control that does nothing is worse than no control. The approach is the one Hidde de Vries describes, listed below.
Your choice is kept in your own browser, and only while it differs from your device. Switch back to what your device says, and the site follows the device again. Change the setting of the device itself, and the device wins. Nothing leaves your browser.
The switch is there for one of the reasons above: it lets me show a client both versions of a site in one click. That makes this site a showcase as well as a website.
The night colours are the same two main colours, the alligator green and the petrol, made lighter for a deep green-black page, and every text colour was measured again: at least 7:1 against the dark background, the stricter of the two WCAG levels. The homepage needed more than colours. Its deep green section now stays deep instead of turning pale. The crosses and waves behind the sections are drawn again in the light colours, so they still show. The header is a shade darker than the page, so the two do not run into each other, and the clay buttons have a soft white glow. Each of those was a separate decision, which is the point of this note.
These are the questions I would ask before adding a dark mode to any site.
Before you add a dark mode
- Design it, do not invert it. Choose every colour again for a dark background; the light palette turned upside down is not a design.
- Avoid the extremes. A very dark background with off-white text reads better than pure black with pure white.
- Check the contrast again. Every text colour needs to pass on the dark background too, not only on the light one.
- Look at the images. Logos, drawings and photos made for a light page are where a dark mode most often breaks.
- Follow the device first. The reader has already made the choice; add a switch only when there is a reason for one, and let the device win again when its setting changes.
- Launch it when both are right. One good mode is better than one good and one half-finished.
Read the originals
- Timothy Hatcher, Dark Mode Support in WebKit (WebKit, 2019). The source of the pull quote, and how a site tells the browser it has a dark version.
- Hidde de Vries, How I built a dark mode toggle (2022). The approach this site follows: one button that says whether it is pressed, the device as the starting point, and the reader’s choice remembered.
- Apple, Apple introduces macOS Mojave (June 2018). The announcement that brought dark mode back to the desktop.
- Thomas Steiner, Improved dark mode default styling with the color-scheme CSS property and the corresponding meta tag (web.dev). The two pieces of CSS that a dark mode needs, and how they work together.
- MDN, prefers-color-scheme. The reference, with browser support.