News for hackers. Stuff that matters.
Re:Safari introduces Adaptive Dark Mode in 27.3 by akersten on Tuesday November 03, 2026 @05:41PM (#50359275)
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()`

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.

Re:Safari introduces Adaptive Dark Mode in 27.3 by have_faith on Tuesday November 03, 2026 @05:53PM (#50359378)
It’s always irked me that light and dark are given privileged positions in the namespace. They’re just themes (or schemes if you like), like all the other possible themes.
Re:Safari introduces Adaptive Dark Mode in 27.3 by steve1977 on Wednesday November 04, 2026 @12:00AM (#50361665)
I'd argue that they are modes of themes, not themes themselves.
Re:Safari introduces Adaptive Dark Mode in 27.3 by tshaddox on Tuesday November 03, 2026 @08:01PM (#50360331)
I’m not sure what kind of function you’re asking for that would support arbitrary user-defined themes. With the if() function and/or @function declarations you could build pretty much any system you want for defining theme-specific values for arbitrary themes.
Re:Safari introduces Adaptive Dark Mode in 27.3 by hexasquid on Tuesday November 03, 2026 @08:18PM (#50360434)
Web standards are discussed in the open aren't they? I'll see if I can find what reasoning lead to this.
Re:Safari introduces Adaptive Dark Mode in 27.3 by hexasquid on Tuesday November 03, 2026 @08:22PM (#50360462)
https://github.com/w3c/csswg-drafts/issues/7561 appears to be a place to start digging
Re:Safari introduces Adaptive Dark Mode in 27.3 by omer_balyali on Tuesday November 03, 2026 @08:23PM (#50360469)
Color schemes (luminance modes) and color themes (aesthetic styles) are not the same thing. Halloween theme can have light and dark schemes.

Also, prefers-contrast media query exists, which can be used in combination with the luminance modes (color-scheme): halloween-light, halloween-dark, halloween-light-high-contrast, halloween-dark-high-contrast.

https://news.ycombinator.com/item?id=47832705

Re:Safari introduces Adaptive Dark Mode in 27.3 by Griffinsauce on Wednesday November 04, 2026 @02:52AM (#50362548)
A real loss for colour blind people. This could have been a vehicle for colourblind-aware themes.
Re:Safari introduces Adaptive Dark Mode in 27.3 by BoppreH on Wednesday November 04, 2026 @06:35AM (#50364196)
I actually like `light-dark`. It's a shortcut to something that can be done more comprehensively with other, longer forms, but tailored to the most common (by far!) use case. It's a wart in the spec (specific color schemes as keywords) so that we can remove the warts in our code (media query blocks in CSS).

It's not like CSS was pure and elegant to begin with, so why not add an oddity that is actually useful?

Re:Safari introduces Adaptive Dark Mode in 27.3 by Timon3 on Wednesday November 04, 2026 @06:59AM (#50364385)
IMO this would have been the perfect way to ensure the feature won't be useful for anyone. You need buy-in from both developers and users for something like this. Developing one alternate color scheme that everyone supports is a thousand times easier to justify than developing n alternate color schemes that most people don't care about.

And by naming the function `light-dark()`, they explicitly left the door open to introduce something like you suggest in the future. Had they already named the function something more generic, it would limit the flexibility of any future API!