News for hackers. Stuff that matters.
Re:Safari introduces Adaptive Dark Mode in 27.3 by kickingvegas on Tuesday November 03, 2026 @05:02PM (#50358866)
Re:Safari introduces Adaptive Dark Mode in 27.3 by kps on Tuesday November 03, 2026 @05:09PM (#50358958)
And `:prefers-color-scheme` has been supported by all major browsers for seven years.
Re:Safari introduces Adaptive Dark Mode in 27.3 by jansan on Tuesday November 03, 2026 @05:15PM (#50359025)
And broken in Chrome since the beginning:

https://issues.chromium.org/issues/366412383

Re:Safari introduces Adaptive Dark Mode in 27.3 by kulahan on Tuesday November 03, 2026 @05:21PM (#50359076)
So I guess it hasn’t been supported anywhere in a sense.

Safari and Firefox are pretty small.

Re:Safari introduces Adaptive Dark Mode in 27.3 by zamadatix on Tuesday November 03, 2026 @05:26PM (#50359130)
I wouldn't call this part of the situation a bug. I'm sure everyone has their own opinion about which is the "right" way to handle a mismatch of OS level preference and browser level theme though.

The underlying problem is Chrome exposes no (normal) setting to override the OS level setting at all, not necessarily that the preference shall always follow the browser's theme specifically.

Re:Safari introduces Adaptive Dark Mode in 27.3 by jansan on Tuesday November 03, 2026 @05:47PM (#50359327)
I am not sure how someone can think it is correct to follow the OS settings for browser content if the browser explicitly allows setting the dark mode. What else is the browser setting for?
Re:Safari introduces Adaptive Dark Mode in 27.3 by phatskat on Thursday November 05, 2026 @03:09PM (#50383817)
I contend that this is a bug, as the browser is the User Agent. To me, this means that if the user tells the browser "use the dark theme", it's the browser's job to communicate that to the page
Re:Safari introduces Adaptive Dark Mode in 27.3 by omer_balyali on Tuesday November 03, 2026 @05:32PM (#50359182)
This issue is related to appearance setting inside Chrome itself (which sets Chrome's appearance, not how it should work with websites AFAIK). The core feature of prefers-color-scheme (following the OS-level setting) is working as intended.
Re:Safari introduces Adaptive Dark Mode in 27.3 by jansan on Tuesday November 03, 2026 @05:52PM (#50359370)
It is not true that prefers-color-scheme should always follow the OS-level setting. The doc says "The method by which the user expresses their preference can vary. It might be a system-wide setting exposed by the Operating System, or a setting controlled by the user agent."[1]

So if the user sets dark mode in the browser, do they not explicitly express their preference for websites? How could they be more explicit about the setting?

[1]https://drafts.csswg.org/mediaqueries-5/#prefers-color-schem...

Re:Safari introduces Adaptive Dark Mode in 27.3 by omer_balyali on Tuesday November 03, 2026 @06:41PM (#50359769)
I didn't meant that "only OS-level setting should be respected", what I meant is that Chrome's setting is how Chrome themes should look like, not for websites.

Chrome already has a setting to change a specific website's color-scheme, although it's only working when Developer Tools is visible (then with Cmd+Shift+P "Toggle CSS media feature prefers-color-scheme"), so CSS implementation actually follows respecting UA-level preference over OS-level setting.

But again, Chrome doesn't have a feature that lets users to choose which color-scheme they want to browse the web (so there is no bug, but it's a UX issue because their Appearance settings doesn't make it clear to the users what this setting changes) other than the setting they gave to developers. Honestly I would love to see all browsers have an option for how color-scheme settings should apply to websites.

Re:Safari introduces Adaptive Dark Mode in 27.3 by jansan on Tuesday November 03, 2026 @07:04PM (#50359948)
You can set the appearance mode (light, dark, device) under chrome://settings/appearance . If you change the mode, the settings page (which is a website) adopts that mode, so a user would naturally assume this is also the mode for displaying web content.
Re:Safari introduces Adaptive Dark Mode in 27.3 by omer_balyali on Tuesday November 03, 2026 @07:19PM (#50360066)
Yes it's confusing for the end-user, as I said they should improve their UX in that setting page to make it clear what this setting changes.

However, your original comment was saying that prefers-color-scheme is bugged in Chrome is not true. It works as intended: it follows both UA-level and OS-level settings correctly.

The settings in Appearance tab is not a setting for preference when browsing the web. Many apps have a setting to choose if their app should change appearance when OS setting changed (or to override it), they could simply leave out this setting and let Chrome chrome (app ui) always follow the OS setting or always be in default light mode, instead they gave users to choose "how their Chrome browser will look like", not "how every website they visit should look like".

Re:Safari introduces Adaptive Dark Mode in 27.3 by cosmotic on Tuesday November 03, 2026 @05:25PM (#50359118)
Windows 3 through windows 7 had pervasive support for dark mode as long as application developers didn't custom paint their user interfaces. Application developers started out almost all supporting system colors and gradually over the next 25 years or so started implementing their own custom-drawn interfaces, accelerated by embedded IE/mshtml views and then later even more by Electron. This concluded with practically zero interfaces supporting the system color scheme.
Re:Safari introduces Adaptive Dark Mode in 27.3 by toyg on Tuesday November 03, 2026 @06:08PM (#50359492)
Yeah, when dark mode became "a thing" my first reaction was "...didn't we have this already?"
Re:Safari introduces Adaptive Dark Mode in 27.3 by da_chicken on Tuesday November 03, 2026 @06:12PM (#50359526)
Yeah but "dark mode" for Win3 through WinXP was primarily to support passive matrix LCDs, which required inverted color schemes to appear black-on-white. That is why the built-in "high contrast" color schemes look so aggressively awful.
Re:Safari introduces Adaptive Dark Mode in 27.3 by pxoe on Wednesday November 04, 2026 @01:26PM (#50369567)
In lieu of actual system wide dark mode for everything in Windows 10, even those awful "inverted" color schemes were useful and quite bearable after adjusting colors a bit (like this one for example https://github.com/nitschis/GreyEveTheme ), so it was at least better than nothing. It's no longer a problem in 11 though.
Re:Safari introduces Adaptive Dark Mode in 27.3 by Rohansi on Tuesday November 03, 2026 @07:17PM (#50360048)
Custom painting isn't the only thing that broke it. You can customize the style (colors) of the native widgets to get a desired look but IIRC you could choose from system colors (follows the theme/mode automatically) or exact colors. Some applications used a mix of them which made the UI look awful if you switched away from whatever the default theme was.
Re:Safari introduces Adaptive Dark Mode in 27.3 by Melatonic on Wednesday November 04, 2026 @12:08AM (#50361698)
[delayed]
Re:Safari introduces Adaptive Dark Mode in 27.3 by denkmoon on Wednesday November 04, 2026 @12:14AM (#50361716)
[delayed]
Re:Safari introduces Adaptive Dark Mode in 27.3 by jansan on Tuesday November 03, 2026 @05:13PM (#50358999)
I wonder what Chrome returns. Is it still broken and returns the OS setting, or like other browsers that do it correctly the browser setting?

https://issues.chromium.org/issues/449408579

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!