Learned something about "dark mode" today.

My GTK3 config uses the dark variant of its theme. This is not just a
dark theme, but it has a flag indicating "dark mode". That flag gets
picked up automatically by browsers (lariza and Firefox -- but not
Chromium, it needs a special command line option). This not only results
in a dark UI of those browsers, but they also use this flag to
automatically select dark versions of web sites.

For example, my web site does this:

   @media (prefers-color-scheme: light) {
       :root
       {
           --page-bg: whitesmoke;
           --text-fg: black;
           ...
       }
   }
   @media (prefers-color-scheme: dark) {
       :root
       {
           --page-bg: #2B2B32;
           --text-fg: #CCCCC2;
           ...
       }
   }

So, some CSS variables get set depending on which scheme the browser
prefers. Again, this is automatic.

I talked to my co-workers about this topic and told them that even
https://www.openbsd.org had such a dark mode. They opened the page and
were utterly confused. "There is no dark mode!"

Then finally someone asked: "Where is the button to turn on dark mode?"

And then it dawned on me.

Apparently, a "system-wide" dark mode is not what people actually use.
This explains a lot.

Most of all, I see a lot of web sites that actually have such a switch.
A button you have to click. It switches the page's theme and installs a
cookie. I never understood why pages would work that way -- why not use
CSS as shown above? (You could even use CSS to identify users of dark
mode on the server ... so not even from this point of view is there a
benefit for web pages or ad companies.)

See, there was so much fuzz about "dark modes" in the last couple of
months, that I blindly assumed that we're talking about an automatic
dark mode. Because, come on, being able to chose a different theme on a
web site is a really old feature. There's nothing special about that.

Now it makes sense. Browsers of (most?) people simply aren't being run
"in" dark mode. Those browsers don't know that they should show a dark
page.

This is a bad idea, if you ask me. Instead, tell your toolkit about your
wish to run the dark variant of a theme and everything else should
adjust accordingly, automatically. (Ideally, don't tell it to each
toolkit individually, but to your "session" and the toolkits pick up
that setting.)

I can only guess that "dark mode" in GTK is relatively new. I have only
started using it this year, I think, but I was aware of this for quite a
while. GTK2 doesn't support it, only GTK3. So, for a change, I am ahead
of my time. Who would have thunk. I don't know macOS at all, but
honestly, I kind of assumed that they had this feature for years. Maybe
I'm wrong?

Chromium even has a couple of "flags" regarding dark mode. By "flags" I
mean stuff in "chrome://flags/", so technically they are "experiments".
One of those "forces" the browser to render pages in dark versions. But
that's something else entirely: It's algorithms that try to calculate
those dark versions. They ignore the CSS switch. Maybe that's a relic
from earlier times?