Re: [csswg-drafts] [css-color-adjust] Re-add `only` to mean "don't auto-adjust me", per WebKit's behavior (#5089)

Been discussing a bit with some other engineers.

Looks like currently, we have at least three independent auto-darkening efforts:

* iOS auto-darkens web content in some apps, such as Mail, but not (yet?) in general Safari
* Samsung auto-darkens web content in general (if you turn on a pref, I presume?)
* Chrome Webview has an option to enable auto-darkening, and we have a flag on Canary that can flip it on for arbitrary web content

So this is more widespread than I'd thought, and we do indeed need some spec text for it. And none of the three 
I'm aware of do this via a mechanism resembling Forced Colors Mode, as the spec currently assumes.

At *bare minimum*, we need the following:

1. Describe when auto-darkening can happen.
2. Describe how to opt-out of it.

Ideally, we'd additionally have a well-specified algorithm for how auto-darkening works. Without that, authors might test their page in one browser, note that the auto-darkening gives an acceptable result, and leave it be without writing an explicit dark theme; then in another browser with a different auto-darkening mechanism, it might look broken. That's bad for everyone! But I recognize this is still the early days, and specific details of how to do it best might still be too up in the air to nail down in spec text yet.

----------

So I propose:

1. Specify that if the user's preferred color-scheme is *not* present in the list of 'color-scheme' keywords, 
 the user agent *may* make the user's preferred color scheme a "forced color scheme".

 A "forced color scheme" will at minimum have [the effects specified for 'color-scheme' currently](https://drafts.csswg.org/css-color-adjust/#color-scheme-effect), such as adjusting browser UI and setting the system colors appropriately. It may have arbitrary additional effects, currently explicitly undefined, on colors and/or images on the element.

 However, if the user's preferred color-scheme *is* present, this won't happen, and you'll *just* the specified effects for the used color-scheme.

2. Re-add the "only" keyword to opt-out of "forced color scheme" on the element.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5089#issuecomment-844525850 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 19 May 2021 22:08:45 UTC