alt.hn

4/19/2026 at 6:36:00 PM

Six Levels of Dark Mode (2024)

https://cssence.com/2024/six-levels-of-dark-mode/

by Akcium

4/20/2026 at 11:17:38 AM

Theming vocabulary is a mess. "Theme", "mode", "scheme", and "palette" are used interchangeably even though they describe completely different layers of abstraction.

My mental model is as follows:

- Palette: All primitive color values.

- Luminance mode: light and dark modes (what CSS and operating systems call "color scheme").

- Contrast mode: Default and high-contrast modes.

- Color Theme: The named aesthetic identity like "espresso", "summer"... expressed as palette values mapped to semantic roles (surface, primary, text…), defined for each luminance × contrast combination.

For example, a website might have:

- 3 color themes: "monochrome", "espresso", "summer".

- Each color theme might support luminance modes, like "espresso-light" and "espresso-dark".

- Each luminance mode might support contrast modes as well, "espresso-dark-default" and "espresso-dark-high-contrast".

- Palette is all the values that "espresso" color theme consists of including luminance and contrast mode values.

The combinatorial complexity might look scary but most products only need a slice of it: two luminance modes, no contrast modes, one color theme.

by omer_balyali

4/19/2026 at 11:00:37 PM

I thought this was going to be about how people prefer different levels of blackness for the background in dark mode. I've heard people say that pure black is more battery efficient for OLED displays (but don't know if this is true), and I know some folks prefer a less-inky grey.

I was wondering how there could be six levels though; I'd think 3 or 4 would be the most anyone could notice or care about.

by apparent

4/20/2026 at 5:51:24 AM

I do wish there was more conversation around the levels of blackness for dark modes. Black screen and white text is physically painful for me. I usually have to resort to reader mode, or open up dev tools and change colors myself, to make a page like this readable for me.

I appreciate how hard it can be to make a good dark mode; I've spent months building a custom dark theme I term "mid-contrast". It's still WCAG compliant, but easy on my eyes, and I've stuck with the (maybe silly?) requirement of 16 colors only, like Solarized.

by Tallain

4/20/2026 at 9:51:05 AM

I'm the opposite. Anything other than pure white on pure black for dark themes gives me eye strain. If you use the dark reader web extension you can adjust the brightness and contrast to your liking.

by 2ndbigbang

4/20/2026 at 10:56:06 AM

As it should be - the browser is termed a "user agent" for a reason. There should be browser settings for preferred dark (and light) colour schemes.

Actually - there are to a very small extent. But they are near useless, defining only the colours of uncoloured elements.

by dotancohen

4/20/2026 at 11:19:17 AM

I don't like white text on a pure black background either, but for me the solution is to dim the text, not brighten the background. I can't stand the push away from allowing pure black for OLED devices based primarily on Google's design strategy. Though personally I don't want to force my specific preferences on everyone and instead think people should be able to configure it how it suits them best. That's all I want for myself.

by duskdozer

4/20/2026 at 12:05:40 PM

there's a firefox (maybe chrome too) extension called dark reader

not only it wil dark-ify pages that don't support dark mode, it will alter the tone of dark mode pages to a more enjoyable (i like to add some pastel colors)

for dark mode pages that are already perfect, you can disable it on a per page basis

only trouble i had so far is that disabling or enabling happens per-site. so I can't have dark mode on google, disabling it on google maps

by nextaccountic

4/20/2026 at 12:26:04 PM

Seems like "Reader Mode" ought to be the default for a user agent.

by wffurr

4/20/2026 at 8:16:32 AM

Pure black background with pure white elements is a common accessibility issue.

And just curious, why would using "only" 16 colors be silly?

by bryanhogan

4/20/2026 at 1:04:20 AM

The more universal solution would be to standardize Reader Mode compatibility, and for browsers to let users configure how they want Reader Mode to look.

In other words, instead of an n x m solution where every web site has to cater to each different user preference, there should be a simplified content view that every web site only has to support in a singular way, and that allows browsers to cater to the various user preferences.

by layer8

4/20/2026 at 2:20:02 AM

This likely would have happened already if it weren't for Google's hostility to Reader Mode. It's hilarious to see the Reader Mode that they offer, where it's a resizable 2-column view, to ensure that ads are loaded and kept in sight. We get it, Google: you don't want to endanger your ad revenue.

by apparent

4/20/2026 at 11:21:34 AM

But wait - Reader Mode messes with our branding, nudges, and calls to action, and breaks my sleek, modern animations and scroll effects.

by duskdozer

4/20/2026 at 6:23:03 AM

Shh, don't tell web designers about reader mode! They'll try to break it!

by a96

4/20/2026 at 2:52:13 AM

It's just n x 2 for light and dark themes.

by f33d5173

4/20/2026 at 4:56:27 AM

I feel like we could go beyond that, especially for more app-like experiences. Maybe we want themes that do things like "add specific trim to make editable fields more identifiable." or adding "high contrast" versions of the themes for low-quality screens or low-vision users.

There's no reason a webpage shouldn't be as themable as, say, a GTK or Qt based desktop application.

We should be trying to snatch back styling power from the designers and putting it back on the user-agent's side. Let the page look brutalist until the user has chosen an appropriate theme for their needs rather than railroading them into what someone in Marketing decided looked good.

by hakfoo

4/20/2026 at 6:45:44 AM

The comment I was responding to was suggesting n x 6. And there are also aspects beyond brightness and contrast, like font styles and sizes, line height and margins, justification and hyperlink style, and so on. The things you can or want to configure in an e-book reader.

by layer8

4/20/2026 at 6:18:27 AM

It is significantly more efficient for oled displays, as off oleds don't use power. It also causes burn in on a smaller part of the display which is usually good (but this could end up being a disadvantage over time as the burn in contrast is higher).

It's also more efficient for led matrix backlights.

Edit: sorry, realized this is misleading: my testing was with light vs dark, not something like dark grey vs 00 black

by literalAardvark

4/20/2026 at 2:33:15 AM

>I've heard people say that pure black is more battery efficient for OLED displays (but don't know if this is true)

No.

https://www.xda-developers.com/amoled-black-vs-gray-dark-mod...

by gruez

4/20/2026 at 5:23:41 AM

Did you even read before pasting? Yes technically it is, which would indeed be in line with "levels of dark mode".

by K3UL

4/20/2026 at 3:52:50 AM

Grayish dark themes are underrated

by mudkipdev

4/20/2026 at 1:11:39 AM

for OLEDs, I tend to prefer pure black because it doesn't burn-in. Since they have a limited lifetime, any "on" time is costing me usage in the long-long-long run and I'd rather have my monitor last 5+ years than ... 2 or 3.

by t-writescode

4/20/2026 at 2:37:18 AM

>any "on" time is costing me usage in the long-long-long run and I'd rather have my monitor last 5+ years than ... 2 or 3.

Going from dark gray to pure black isn't going to halve your monitor expectancy, if it makes a difference at all. Due to how human perception works something that's merely dark gray is actually orders of magnitude brighter than pure white, or even 50% gray. Therefore most of your burn-in is going to be driven by bright content like photos or white text, not whether you're using 5% gray vs pure black.

by gruez

4/20/2026 at 5:37:05 AM

kind of sad that the CSS specification wound up with this clunky `light-dark(white,black)` thing instead of literally anything more extensible like, `themed(dark(black), light(white), retro(purple))`.

Then you'd be able to have a cool theme dropdown like sites used to have, fully CSS-driven with essentially no JS required, in a compatible and modern way.

by akersten

4/20/2026 at 8:35:50 AM

Like the xkcd one?

https://xkcd.com

Not sure if it shows up for everyone, but there was a popover under the comic that did all kinds of crazy themes.

by ChrisMarshallNY

4/20/2026 at 9:42:44 AM

https://xkcd.com/3227/

by 2ndbigbang

4/20/2026 at 10:16:19 AM

Yup. Thanks!

by ChrisMarshallNY

4/20/2026 at 9:56:19 AM

What is the recommended way to add support for additional functional themes to support users like colour vision friendly, high contrast for poor vision, daylight mode, and night vision preserving (no blue channel) - rather than just light/dark?

by intronic

4/20/2026 at 12:02:40 AM

Is there still no way to prevent the flash bang while waiting for initial content from the server?

by zamalek

4/20/2026 at 7:47:22 AM

A small blocking `<script>` in the `<head>` that reads the saved preference from localStorage and sets a class on `<html>` before any rendering happens is the standard approach. You can also set `<meta name="color-scheme" content="dark light">` which tells the browser to use the OS preference for the initial paint, covering the default case without any JS at all.

by ethan_smith

4/20/2026 at 1:58:45 PM

That's still after the server's response arrives, they're talking about the blank browser page before anything comes back in the response.

by Izkata

4/20/2026 at 12:16:28 AM

Use `background-color` in Firefox's `userContent.css`.

by silverwind

4/20/2026 at 1:58:46 AM

I love the idea of ending it for myself, but my users are still screwed?

by zamalek

4/20/2026 at 5:32:36 AM

how your users' browsers choose to render `about:blank` while waiting on your page to be delivered is outside of both your control and concern

on Gnome i've got system-wide dark mode turned on and idk, my Firefox is dark gray until it gets any content. so users have the power and should exercise it to tailor their experience as they wish

by akersten

4/20/2026 at 2:12:16 AM

I don't know if I misunderstand the problem, but what about a style tag at the earliest part of the page indicating the background color to use?

by jagged-chisel

4/20/2026 at 3:08:20 AM

That flashbang happens during the initial latency (DNS, RTT, any server slowness).

by zamalek

4/20/2026 at 2:15:48 AM

make dark mode the default, then it's a flash of dark in either case

by MitPitt

4/20/2026 at 3:06:11 AM

send a blank black page then load from there?

by NSPG911

4/20/2026 at 12:06:46 AM

Decrease screen brightness. Turn off dark mode. No flashbang. Bonus: Battery lasts longer.

by pocksuppet

4/20/2026 at 12:06:23 AM

Level 9 (or 0): Turn off the computer and go to sleep.

by yyy888sss

4/19/2026 at 10:48:08 PM

Glad OP got the tri-state toggle right!

by gwern

4/20/2026 at 1:49:59 AM

> Dedicated files make sense if you do a lot of customization. The browser may ignore any CSS file that does not match the query, so there’ll be one less thing to download.

That’s not how it actually works: in practice, browsers download them all. They may prioritise them differently, but they’ll still download them all in the end.

by chrismorgan

4/19/2026 at 10:28:27 PM

Would've been cool if the levels came into effect while you scrolled down the page

by sambellll

4/20/2026 at 2:09:10 AM

Or were selectable by the reader at each appropriate position in the page.

by jagged-chisel

4/19/2026 at 11:18:15 PM

It's 8 levels though?

by stevage

4/19/2026 at 10:32:38 PM

Obligatory ? https://xkcd.com/3227/

by andrehacker

4/20/2026 at 2:50:37 AM

Ah, the unofficial sequel to The Last Question.

by mrexroad

4/20/2026 at 3:18:32 AM

so sad that he disabled this ability to propagate to other pages :(

it was the first time my eyes got comfortable reading his comics

by NooneAtAll3

4/19/2026 at 10:41:19 PM

2024

by everybodyknows

4/20/2026 at 5:27:48 AM

[dead]

by lokthedev