FYI, light-dark() in CSS is a thing now.
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/V...
It makes me so angry that they named the CSS function `light-dark` instead of leaving the door open to allowing generic user- or site-specified color schemes. I mean it was right there in all the other mechanisms around this feature, they just had to read and think about why these are structured the way they are, and why "light" and "dark" were always values and not keywords in all of these..:
- <meta name="color-scheme" content="light dark">
- :root { color-scheme: light dark }
- @media (prefers-color-scheme: dark) { }
- <picture><source media="(prefers-color-scheme: dark)">
.... and then we've got `light-dark()`, the goofy looking dragon hanging out to the side of these majestic, forward-thinking parts of the specification.Did they not look at the prior art and notice that "one of these things is not like the other?" All the other pieces of this puzzle, conceivably, could have one day had something like `:root { color-scheme: halloween }` or `@media (prefers-color-scheme: supercontrast)` but no, we're just going to cement `light-dark()` as the only two possible color schemes we'd ever want to switch between forever.
And `:prefers-color-scheme` has been supported by all major browsers for seven years.