-
Notifications
You must be signed in to change notification settings - Fork 688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-color-adjust-1] Limits on the only
color scheme keyword
#3881
Comments
I do not agree with restricting Consider the following use cases (which have been mentioned previously, but I don't think everyone quite understood them):
As currently spec'd, the only way for the website author to get dark mode form elements and scrollbars in either of these cases is to style them from scratch using If we support The whole reason for exposing dark mode controls is to make it easier for authors to use the native controls instead of re-implementing them. Preventing authors from requesting dark mode widgets counteracts this. |
If the page uses The only difference from So, since the only difference between |
The The If you say Also |
I strongly regret caving in on this during the phone call, because I had not considered the algorithm properly when I said I could achieve what I wanted with It is absolutely incorrect to say that a website is not respecting the user choice when requesting Besides, in most cases, restyling all controls to enforce dark yourself is not going to work properly anyway, because styles do not have subtle enough control over some controls (like scrollbars, select menus, pop-overs and many parallel ui surfaces likes selection). These elements cannot be styled properly for dark mode because not enough information is known about the platform to have a native feel for the dark theme, so an arbitrary choice has to be made and that cannot possibly match all platforms. Moreover, the argument given by @dbaron that Firefox on Linux cannot support a dark theme looks bogus to me. If an operating system does not provide a way to get dark form control theming, browsers can draw these control themselves using the fallback theme like they already do for light-theme control with non-default styles. There is nothing stopping any browser to do that. This would still look better than forcing a site to use light form controls with a dark theme otherwise. |
@xeenon To clarify, you're suggesting a situation where the user agent would override author styles to apply a dark/light mode? I think that's outside what we're talking about here, and is more consistent with the We should spec that a forced color mode can override the |
@AmeliaBR Ah, yep. I didn’t realize that split off into |
I'd be more sympathetic to @FremyCompany's position that we could switch to non-native controls if we had a spec for how form controls worked (including details of rendering, and which CSS properties apply and what effects they have) and browsers were implementing it. In the absence of such a spec, we're stuck chasing each other for web compatibility, and that chasing is a good bit harder when you have multiple platforms to worry about. |
css-color-adjust-1 mentions property |
@dbaron That is fair, and that is definitely something that should be worked on eventually. But in all fairness, that problem isn't new. In the end, we only introduce an ability to switch the colors of the fallback theme here, not a new type of layout for these controls. The fallback theme is already in use on most author-styled form controls on the web today, since changing pretty much any css property on these controls triggers the fallback. Dark theme wouldn't affect layout or anything, it's pretty much only about changing the colors you use for text and backgrounds; Based on that, I will admit I don't see how changing the colors of the fallback input controls is an additional compat risk, but maybe I'm missing something out (totally possible!) |
The risk I'm talking about is that of triggering the fallback controls in more cases. |
That is absolutely not what the spec says, which we copied over with only light alterations from Rune's first draft of a spec. If the page says If y'all are doing something different, please describe exactly what it is (in a new issue) so we can discuss altering the algorithm for choosing a used color scheme. (This, btw, is why you should write the dang spec for features you're leading and shipping early on; if you make us guess what you're doing, we won't necessarily match it correctly.) |
@tabatkins From what I recall, they use |
@tabatkins We described this last year in #3299, which is still open. Indeed, it does look like that original intent (color scheme transformations at least) was lost in translation. |
I consider this whole |
@MatsPalmgren I think we all agree that the ideal authoring behavior is to create websites that respect dark/light mode preference. There is text in the spec to that effect:
It doesn't help users if browser modifications of the styles result in broken, unusable websites (e.g., see @dbaron's comments & the linked bug in #3299 (comment) ). So at the very least, we need a way for authors to indicate that replaced elements and initial styles can be safely switched to a dark mode or any future color scheme — without creating dark text on dark backgrounds, or imperceptible focus outlines, or similar design and usability disasters. As for the If a website indicates that it isn't designed for a given mode, then browsers could offer users the option to switch into a forced colors mode. @xeenon's comments above show that WebKit was clearly thinking of this option as a future enhancement. But hopefully the definition of how it works can be integrated with the work we're doing to standardize Windows High Contrast Mode. What's important about WHCM/forced colors mode is that it sets colors and backgrounds for every element, not just the root, to ensure that good combinations are maintained throughout. Note that, as currently spec'd, an |
Ah, you're referring to "If the user's preference does not match something in the list, the UA is allowed to apply transformations to the content (e.g. apply high-contrast)." from Simon's post. If that's the extent of it, opting the page into forced-colors mode, then that's fine, it's just a separate feature that's technically orthogonal to this. But if y'all are planning on doing something separate from forced colors, please actually describe it in a new issue so we can talk about it. We're trying our best to make sure these features are described accurately and fully, so authors can have a reasonable idea of how their pages will look. If the "same" feature ends up still acting substantially differently between browsers, then there's no point to it being standardized at all. |
@tabatkins The Apple color-scheme-transformer uses a proprietary I'd note that this was described in decent length at the last or before-last meeting as far as I can remember, at least to me (but maybe that's because I asked). FWIW, the Windows Mail client also does something along those lines, but I don't know how that one works. Someone from inside Microsoft should ping that team and ask them. I agree it would be nice if they applied the same type of transform, and we could standardize this at least somewhat. Ping @gregwhitworth ? |
Yeah, dino's given a few presentations about color adjusting stuff in the past, most of which I thought was superceded by this feature. If that's not the case and some of it is still relevant, it would be great to see that actually described in an issue. |
Our app respects OS color scheme settings by default, but it also provides an option for the user to expressly choose the color scheme. This is useful if a user is visiting on a device which they’re only using temporarily, for example, or if the user just happens to have application-specific preferences. Leveraging I was surprised by the spec’s ‘should not use’ and some of the comments in this thread.
These well-intentioned statements seem to include an assumption that users only communicate their preference through one channel, OS settings (and can do so in the first place). It’s not sound to conflate ‘global OS setting’ and ‘explicit user choice’. Users are not OSes. There are users who will not or will not always have control over OS settings. An example cohort fitting this profile is public library visitors. I understand concern over theoretical misuse, but I believe it’s premature and that ‘fight[ing] hard to make Gecko [...] ignore it’ is not the accessibility win one might think. It’s the opposite. |
Agenda+ to ask the WG to restore "only dark" as a possibility. There is a community of users that won't get dark form controls on such a page (some Linux OSes), but I think that's outweighed by the cost to all users of pages switching to JS-driven custom controls just to get dark controls by default. (Notably, last time we discussed this Safari indicated that it would never match |
(Android also currently only exposes "light" and "dark", with no way to indicate "no-preference", ugh.) |
Actually, we can go stronger than this. If, per #3857, we drop the If we drop the first column, then the only difference between Note: it will not match the user's preference! Browser default is constrained to be This will become more weird/problematic if we ever add more values: if we assume My suggestion is:
This means that |
In Firefox, it's likely that we will move away from rendering widgets using the platform native appearance, and once we control the widget rendering we will add support for dark form controls on platforms where that's difficult now, like Linux. |
The CSS Working Group just discussed
The full IRC log of that discussion<dael> Topic: [css-color-adjust-1] Limits on the `only` color scheme keyword<TabAtkins> https://drafts.csswg.org/css-color-adjust/#color-scheme-prop <dael> github: https://github.com//issues/3881#issuecomment-631115953 <dael> fantasai: Should we do color adjust when we've got Rossen? <dael> astearns: This would be good to get to <fantasai> s/grid/grid, particular wrt lines rather than images/ <dael> TabAtkins: Now that we resolved to drop no-preference from color scheme the table I linked to above to showcase interaction gets simplier <dael> TabAtkins: If we drop no-preference column than light and dark look similar. Only difference is if the author says light and user wants dark or otehr way neither gets what they want and we use browser default. In all other cases author preference wins. <dael> TabAtkins: Since only cases are author wins or no one wins and we get browser I think we should simplify and make it so that if you say light or dark that's what you get. We drop the only keyword as meaningful value <dael> TabAtkins: Existing pages using only will continue to work exactly as they have <fremy> lgtm <dael> TabAtkins: Drop the only keyword and make light or dark respect author preference. If it's light or dark it's user preference <dael> TabAtkins: Obj? <dael> emilio: uneasy about overwriting user prefernce. Not really objecting <fantasai> s/light or dark/'light dark' (allowing light or dark, preference to light) <dael> TabAtkins: User preference if honored if author is okay with lgiht or dark. Existing preference wasn't respecting user preference either, just author preference or going to browser default. <dael> astearns: Other concerns with this change? <dael> astearns: I like simplification. It's something we could complicate in future. At this point in time simplification makes sense. <dael> astearns: Prop: Remove the 'only' keyword and simplify the table in the spec <dael> AmeliaBR: No objections. Same as with MQ a not mentioning the dropped value would be useful if people try and look up <dael> TabAtkins: Happy to do that <dael> fantasai: Need text to parse <dael> TabAtkins: Parses due to property extensibility. It's a dropped unknown keyword <dael> RESOLVED: Remove only keyword, simplify the table, add a note about dropping only |
…yword from 'color-scheme', and adjust the resolution rules to always respect author preference. Since the used color scheme resolution rules are now simple enough to inline, remove the table and the algorithm. Also add some examples highlighting good practice.
Sorry, I had to look at code to confirm, and wasn't in front of a computer at the time. WebKit uses the "only" keyword to prevent auto-transformations (i.e. auto-darkening). So "light only" is an indication by the author that they don't want their content to be auto-darkened. Just "light" allows auto-darkening. |
Okay, so it sounds like the answer to #5089 is "yes, WebKit is doing color adjustment not described by the spec". |
Right, as noted in #5089 (comment) |
Also please talk to the Chrome people who have looked at auto-darkening in the past. |
That said, that's still a totally different meaning for "only" than what we were defining, so dropping the definition the spec had was still the right decision. I'll rejigger #5089 to be about re-adding |
This change makes 'only' behave like any other <custom-ident>. The used color-scheme can is now matching the preferred if listed, but can also be 'dark' if 'light' is the preferred color-scheme but the computed color-scheme only contains 'dark'. These changes are per resolution[1]. Also improves interop with Safari. Intent to ship: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/3RhZFvZE1LM [1] w3c/csswg-drafts#3881 (comment) Bug: 1087115 Change-Id: I1b7aa199c0dab665ec72703c201ddc2831233cd3
This change makes 'only' behave like any other <custom-ident>. The used color-scheme is now matching the preferred if listed, but can also be 'dark' if 'light' is the preferred color-scheme but the computed color-scheme only contains 'dark'. These changes are per resolution[1]. Also improves interop with Safari. Intent to ship: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/3RhZFvZE1LM [1] w3c/csswg-drafts#3881 (comment) Bug: 1087115 Change-Id: I1b7aa199c0dab665ec72703c201ddc2831233cd3
This change makes 'only' behave like any other <custom-ident>. The used color-scheme is now matching the preferred if listed, but can also be 'dark' if 'light' is the preferred color-scheme but the computed color-scheme only contains 'dark'. These changes are per resolution[1]. Also improves interop with Safari. Intent to ship: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/3RhZFvZE1LM [1] w3c/csswg-drafts#3881 (comment) Bug: 1087115 Change-Id: I1b7aa199c0dab665ec72703c201ddc2831233cd3
This change makes 'only' behave like any other <custom-ident>. The used color-scheme is now matching the preferred if listed, but can also be 'dark' if 'light' is the preferred color-scheme but the computed color-scheme only contains 'dark'. These changes are per resolution[1]. Also improves interop with Safari. Intent to ship: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/3RhZFvZE1LM [1] w3c/csswg-drafts#3881 (comment) Bug: 1087115 Change-Id: I1b7aa199c0dab665ec72703c201ddc2831233cd3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2218828 Commit-Queue: Rune Lillesveen <[email protected]> Reviewed-by: Anders Hartvoll Ruud <[email protected]> Cr-Commit-Position: refs/heads/master@{#775718}
This change makes 'only' behave like any other <custom-ident>. The used color-scheme is now matching the preferred if listed, but can also be 'dark' if 'light' is the preferred color-scheme but the computed color-scheme only contains 'dark'. These changes are per resolution[1]. Also improves interop with Safari. Intent to ship: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/3RhZFvZE1LM [1] w3c/csswg-drafts#3881 (comment) Bug: 1087115 Change-Id: I1b7aa199c0dab665ec72703c201ddc2831233cd3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2218828 Commit-Queue: Rune Lillesveen <[email protected]> Reviewed-by: Anders Hartvoll Ruud <[email protected]> Cr-Commit-Position: refs/heads/master@{#775718}
This change makes 'only' behave like any other <custom-ident>. The used color-scheme is now matching the preferred if listed, but can also be 'dark' if 'light' is the preferred color-scheme but the computed color-scheme only contains 'dark'. These changes are per resolution[1]. Also improves interop with Safari. Intent to ship: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/3RhZFvZE1LM [1] w3c/csswg-drafts#3881 (comment) Bug: 1087115 Change-Id: I1b7aa199c0dab665ec72703c201ddc2831233cd3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2218828 Commit-Queue: Rune Lillesveen <[email protected]> Reviewed-by: Anders Hartvoll Ruud <[email protected]> Cr-Commit-Position: refs/heads/master@{#775718}
… scheme with preferred 'light'., a=testonly Automatic update from web-platform-tests Remove 'only' keyword and support 'dark' scheme with preferred 'light'. This change makes 'only' behave like any other <custom-ident>. The used color-scheme is now matching the preferred if listed, but can also be 'dark' if 'light' is the preferred color-scheme but the computed color-scheme only contains 'dark'. These changes are per resolution[1]. Also improves interop with Safari. Intent to ship: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/3RhZFvZE1LM [1] w3c/csswg-drafts#3881 (comment) Bug: 1087115 Change-Id: I1b7aa199c0dab665ec72703c201ddc2831233cd3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2218828 Commit-Queue: Rune Lillesveen <[email protected]> Reviewed-by: Anders Hartvoll Ruud <[email protected]> Cr-Commit-Position: refs/heads/master@{#775718} -- wpt-commits: f233cde21f970653a2b44b9792d976ed3c05074f wpt-pr: 23825
… scheme with preferred 'light'., a=testonly Automatic update from web-platform-tests Remove 'only' keyword and support 'dark' scheme with preferred 'light'. This change makes 'only' behave like any other <custom-ident>. The used color-scheme is now matching the preferred if listed, but can also be 'dark' if 'light' is the preferred color-scheme but the computed color-scheme only contains 'dark'. These changes are per resolution[1]. Also improves interop with Safari. Intent to ship: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/3RhZFvZE1LM [1] w3c/csswg-drafts#3881 (comment) Bug: 1087115 Change-Id: I1b7aa199c0dab665ec72703c201ddc2831233cd3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2218828 Commit-Queue: Rune Lillesveen <[email protected]> Reviewed-by: Anders Hartvoll Ruud <[email protected]> Cr-Commit-Position: refs/heads/master@{#775718} -- wpt-commits: f233cde21f970653a2b44b9792d976ed3c05074f wpt-pr: 23825
… scheme with preferred 'light'., a=testonly Automatic update from web-platform-tests Remove 'only' keyword and support 'dark' scheme with preferred 'light'. This change makes 'only' behave like any other <custom-ident>. The used color-scheme is now matching the preferred if listed, but can also be 'dark' if 'light' is the preferred color-scheme but the computed color-scheme only contains 'dark'. These changes are per resolution[1]. Also improves interop with Safari. Intent to ship: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/3RhZFvZE1LM [1] w3c/csswg-drafts#3881 (comment) Bug: 1087115 Change-Id: I1b7aa199c0dab665ec72703c201ddc2831233cd3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2218828 Commit-Queue: Rune Lillesveen <futharkchromium.org> Reviewed-by: Anders Hartvoll Ruud <andruudchromium.org> Cr-Commit-Position: refs/heads/master{#775718} -- wpt-commits: f233cde21f970653a2b44b9792d976ed3c05074f wpt-pr: 23825 UltraBlame original commit: ef472c7658576e2c7f6dbe01fe0d1275f2f825a8
… scheme with preferred 'light'., a=testonly Automatic update from web-platform-tests Remove 'only' keyword and support 'dark' scheme with preferred 'light'. This change makes 'only' behave like any other <custom-ident>. The used color-scheme is now matching the preferred if listed, but can also be 'dark' if 'light' is the preferred color-scheme but the computed color-scheme only contains 'dark'. These changes are per resolution[1]. Also improves interop with Safari. Intent to ship: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/3RhZFvZE1LM [1] w3c/csswg-drafts#3881 (comment) Bug: 1087115 Change-Id: I1b7aa199c0dab665ec72703c201ddc2831233cd3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2218828 Commit-Queue: Rune Lillesveen <futharkchromium.org> Reviewed-by: Anders Hartvoll Ruud <andruudchromium.org> Cr-Commit-Position: refs/heads/master{#775718} -- wpt-commits: f233cde21f970653a2b44b9792d976ed3c05074f wpt-pr: 23825 UltraBlame original commit: ef472c7658576e2c7f6dbe01fe0d1275f2f825a8
… scheme with preferred 'light'., a=testonly Automatic update from web-platform-tests Remove 'only' keyword and support 'dark' scheme with preferred 'light'. This change makes 'only' behave like any other <custom-ident>. The used color-scheme is now matching the preferred if listed, but can also be 'dark' if 'light' is the preferred color-scheme but the computed color-scheme only contains 'dark'. These changes are per resolution[1]. Also improves interop with Safari. Intent to ship: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/3RhZFvZE1LM [1] w3c/csswg-drafts#3881 (comment) Bug: 1087115 Change-Id: I1b7aa199c0dab665ec72703c201ddc2831233cd3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2218828 Commit-Queue: Rune Lillesveen <futharkchromium.org> Reviewed-by: Anders Hartvoll Ruud <andruudchromium.org> Cr-Commit-Position: refs/heads/master{#775718} -- wpt-commits: f233cde21f970653a2b44b9792d976ed3c05074f wpt-pr: 23825 UltraBlame original commit: ef472c7658576e2c7f6dbe01fe0d1275f2f825a8
This change makes 'only' behave like any other <custom-ident>. The used color-scheme is now matching the preferred if listed, but can also be 'dark' if 'light' is the preferred color-scheme but the computed color-scheme only contains 'dark'. These changes are per resolution[1]. Also improves interop with Safari. Intent to ship: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/3RhZFvZE1LM [1] w3c/csswg-drafts#3881 (comment) Bug: 1087115 Change-Id: I1b7aa199c0dab665ec72703c201ddc2831233cd3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2218828 Commit-Queue: Rune Lillesveen <[email protected]> Reviewed-by: Anders Hartvoll Ruud <[email protected]> Cr-Original-Commit-Position: refs/heads/master@{#775718} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: d7b48cba6d912c315ecd2d621165ce7152a2c63a
Regarding the
color-scheme
property and its associated meta tag.In the discussion of #3807, there was a lot of debate about acceptable use of the
only
keyword in the property. We made a temporary resolution to adopt the property in the Editor's Draft, with an open issue. There's currently an inline issue in the spec, but this is opening it up for continued discussion.The story so far:
The
only
keyword, as defined in the original proposal, allows website authors to override the user preference expressed in browser/OS settings, and instead directly ask the user agent for a specific color scheme.Some WG members are concerned about allowing authors to override user preferences. Other WG members are concerned that authors will assume that an
only
request for a specific color scheme would always be respected, and won't design for user agents that don't have that color scheme (e.g.,dark
) available.The compromise currently in the spec is to only allow
only
in combination withlight
, and to require user agents to have a light theme available.I'll leave a separate comment with my opinions.
The text was updated successfully, but these errors were encountered: