-
Notifications
You must be signed in to change notification settings - Fork 719
[mediaqueries-5] duplication of forced-colors: active
and prefers-contrast: forced
#5433
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
Comments
Even though I'm a WG member, I'm not able to add the requested labels. Is that intentionally limited to full editors? |
Nope, it's just a manual step for us to add people to the right team. You should be good now. |
Whether or not its the right conclusion is a separate question, but the current idea is: They are indeed the exact same thing. We wish we had though of defining it as So, with that in mind, I think we can take 3 stances:
My stance is (1), and as the spec's Editor, I'll do the editorial clean-up to at least make it clear what the current situation is. I believe your stance is closer to (3). I'd suggest holding off just a bit to see if the clean-up I'm about to do makes things better in your opinion. If it doesn't, it's probably worth re-reading #3856 (I'd say from the top up to and including the teleconf minutes of June 11, after that it goes into a number of tangeants, most of which are answered by #2943 or by the editorial clean-up I'm about to make), and responding to the points that were made in favor of the resolution that was taken then. |
This editorial reorganization of the text is intended to make the overlap between forced-colors:active and prefers-contrast:forced more readily understandable: one being the syntax that the CSS Working Group finds more desirable, the other being retained for compatibility with content issued against an earlier draft. Prior to this refactoring, the definition of this mode was also spread between the two media features, causing confusion. This commits consolidates the whole thing in one place. Related to w3c#5433
This editorial reorganization of the text is intended to make the overlap between forced-colors:active and prefers-contrast:forced more readily understandable: one being the syntax that the CSS Working Group finds more desirable, the other being retained for compatibility with content issued against an earlier draft (see w3c#3856). Prior to this refactoring, the definition of this mode was also spread between the two media features, causing confusion. This commits consolidates the whole thing in one place. Related to w3c#5433
My stance is partially 2 (added 2b below) and fully 3. 2b. Regardless of which syntax is better, there is only one platform that supports this feature and the current syntax is sufficient to cover that platform. Therefore, the benefit isn't strong enough to justify a syntax duplication. If future platform features require additional syntax changes, it would be better to wait until we know what those are.
Yes to this, too. |
…5434) This editorial reorganization of the text is intended to make the overlap between forced-colors:active and prefers-contrast:forced more readily understandable: one being the syntax that the CSS Working Group finds more desirable, the other being retained for compatibility with content issued against an earlier draft (see #3856). Prior to this refactoring, the definition of this mode was also spread between the two media features, causing confusion. This commits consolidates the whole thing in one place. Related to #5433
Some additional context from Mozilla: we implement The "forced" parts of our implementations respond to both Windows HCM and Firefox HCM (about:preferences > colors, the dialog allows users to pick customized colors for text, background, visited/unvisited links). We've been doing some work with folks at Google to make sure G-suite sites render appropriately in Firefox when HCM (windows, ours) is enabled. Google is using these preferences to make adjustments (mostly prefers-contrast: forced, if I remember correctly), but our users won't benefit from them until we can unpref. I don't know that I have enough context to take a stance one way or another, but just wanted to give some more usage context :) |
@MReschenberg wrote:
To clarify, are you saying the Firefox HCM mode on non-Windows platforms (Mac, Linux) will also match the media features? Good to know. Thanks.
By "unpref" do you mean change Firefox to match the Windows system setting? I thought that was already implemented based on your comment that "The 'forced' parts of our implementations respond to both Windows HCM…" |
Yep, exactly -- prefers-contrast: forced will trigger for users running Windows HCM as well as for users on any platform running Firefox HCM.
Ah sorry, bad wording. Right now, Firefox parses prefers-contrast when it finds it in CSS. If it finds the query in a UA style sheet, it'll apply the inner CSS (provided the FF user has some qualifying HCM enabled^). If it finds the query in a non-UA style sheet, it does nothing. The full implementation is available behind a pref (layout.css.prefers-contrast.enabled) in about:config. If that gets flipped, then we'll parse and react appropriately in all style sheets. Does that make more sense? Ultimately, we'd like to do away with the pref entirely and have prefers-contrast on by default (so all users can benefit, not just those that are savvy enough to go into about:config and flip it themselves), but we're waiting for a resolution here. |
The CSS Working Group just discussed The full IRC log of that discussion |
What the difference is between using So why is it easier for Authors to have two ways to write the same code? Sure, they will often be conceptually thinking about contrast and forced colors at the same time — along with light/dark mode, reducing transparency, reducing motion... but that doesn't mean we should try and put all these media queries together into one. Media queries have the power of nesting, AND, OR, etc, so Authors can combine them however they want. As I spent some time after the CSSWG discussion digging into this a bit more, and came to the opinion that we either need to remove In other words, we have three options:
No matter which path we choose, the three options all end up with the same capabilities for Authors — the same usecases and needs are met. It's really a matter of: a) what implementors are willing to do; b) what's best for Authors. I much prefer removing Having two ways to write effectively the same media query conditional, when all this is already complicated (the user preference options on different OSes are very different & most Authors only have access to one)... having two ways to write the same code will only going to result in making Authors think these tools are even more complicated than they actually are. Florian argued:
...so therefore having both situations in one media query will be easier for Authors. I disagree. I think it's confusing — Authors will wonder what the difference is between using They may very well want to do similar things in the code, but these are separate situations that have to be thought through. Plus, It is true that for Implementors these two things are tightly connected. Forced colors does often trip prefers-contrast high or low (not always, depends on the color theme). But Authors won't be thinking about it this way. For them, forced colors is one thing. Prefers high or low contrast is another. Exposing browser engine complexity to Authors doesn't help them. I see in the minutes the argument being raised that Authors will want to reduce visual complexity for both forced colors and for low/high contrast, so why not put it all in one MQ. To me that's like saying people will want to do things for phones, so why make them think through when to use a MQ for screen size vs a MQ for reduced-data? Let's just put the new |
There's no difference indeed.
It's not easier. I'm arguing for both because one of them shipped already so we cannot remove it (at least not easily), and because I see benefits in the other one.
My point is different in a subtle but important way: I don't want to group them so that authors can target all of these users with one query, but because I expect authors will write code that is applicable to all these users with that one query anyway, and asking authors to specifically remember to target a separate small demographic that would be well served by code they already wrote is unfortunate, because some/most of the time they'll forget, and these users will miss out. In more details:
When that happens, this common code will be applied to:
The question is then: should it also apply to users who have picked a forced color scheme that is neither particularly high nor low contrast, or should we require authors to specifically remember that these people exist and to target them explicitly. I'm saying that yes, it should apply, because the shared code is highly likely to be relevant, and authors are overall unlikely to remember to carter for this this relatively small user demographic. Those who do remember still have all the tools needed to tailor the style if a difference is needed, but getting things to work when you don't think about it too much has value. Accessibility gets better when users with similar enough needs are grouped together so that they benefit even when authors don't specifically remember them. I do agree that from a conceptual point of view, forced colors and contrast preferences are different things, and it would be cleaner to have them be separate, which probably affect teachability. So there's a tradeoff. @jensimmons argues that we should pick author understandability over implementer convenience, and this calls for keeping |
As I understand them, all commenters in the meeting and on the GitHub issue are in agreement that either syntax can provide the same functionality and implementability. The disagreements are purely a difference of opinion about the ideal authoring usage. Most also agree that we should keep |
As I understand them, these are the main arguments made in favor of keeping
|
The main arguments I and others made against
|
So as I see it, the primary argument in for keeping There is an assumption that all people with forced colors want some form of reduced complexity. I don't believe this to be true, and I haven't seen any evidence presented to prove this assumption.
There's no disagreement on the above two statements, and both of those relate to a contrast preference. But those aren't the justification for keeping
I do not believe this ↑ premise is true. My gut feeling is that it's not true. I would assume this group of users just prefer to theme their Windows experience, and don't care about reduced complexity at all. Regardless, we don't know enough about this group of users to prove or disprove either assumption. In my opinion, if CSS needs a media feature for |
I think @cookiecrook 's summary in #5433 (comment) and #5433 (comment) is a good one, and I agree that the tension summarized there is the core of the argument to be settled, either by picking a point on the trade-off, or by disproving some of the assumptions, thereby doing away with the trade-off. I'd just add one small nuance:
I don't think we need to go as far as "all users". With "most users", the argument still works, as including Which leads us to
Same here: I'd replace "every user" with "most users". And while I agree the statement with "every" might be a little hard to prove or dubious, it seem much less of a stretch when it's merely "most": when you've opted into a forced (and thus reduced) color palette, you no longer have room for all sorts of decorative things, from a variety of background images, to gradients, or all sorts of embellishments. By picking a forced palette, you're necessarily opting into a visual simplification of some kind. It's going to happen whether we tell the author through a MQ or not, but it's part of the package, so we might as well tell them, so that they can react. |
I think my argument stands even if we change the instances of “every/all users” to “most users.” I don’t know of any evidence that indicates “most” want this. Rather than requesting we disprove the assumption, can someone point to evidence that confirms the assumption? |
Chromium change: https://source.chromium.org/chromium/chromium/src/+/f64b910afa793bde5f50bf88c5b584007ffc68bd commit f64b910afa793bde5f50bf88c5b584007ffc68bd Author: Alison MaherDate: Tue Jan 5 17:02:46 2021 +0000 Refactor contrast tracking in NativeTheme In CL:2412972, it was recommended to split out the concepts of high contrast and forced colors mode inside NativeTheme. Doing so allows us to remove the |is_high_contrast_| variable in favor of |preferred_contrast_|. This also adds a |forced_colors_| variable to distinguish these concepts. I was planning to wait until w3c/csswg-drafts#5433 had been resolved before making this refactor. However, this will likely clean up other areas that will make things like a forced colors devtools emulation cleaner to implement. This will be easy enough to update once the above issue has been resolved (if needed). _________________________________ To explain the distinction of high contrast/preferred contrast/forced colors mode in a bit more detail: - High contrast in most cases triggers a preferred contrast of "more". - Since we are tracking the preferred contrast in NativeTheme, we can remove the redundancy of also tracking if we are in high contrast. - On Windows, high contrast is a bit different in that it also triggers what we call forced colors mode. In forced colors mode, the preferred contrast level may be "more" or "less" depending on which foreground and background colors are being forced. Thus, we also need to track the forced colors state in NativeTheme to detect cases of Windows high contrast that are not considered more or less contrast, but some contrast level in between. _________________________________ This CL should not result in any functional changes. Bug: 1157686,1107431
Chromium change: https://source.chromium.org/chromium/chromium/src/+/f64b910afa793bde5f50bf88c5b584007ffc68bd commit f64b910afa793bde5f50bf88c5b584007ffc68bd Author: Alison MaherDate: Tue Jan 5 17:02:46 2021 +0000 Refactor contrast tracking in NativeTheme In CL:2412972, it was recommended to split out the concepts of high contrast and forced colors mode inside NativeTheme. Doing so allows us to remove the |is_high_contrast_| variable in favor of |preferred_contrast_|. This also adds a |forced_colors_| variable to distinguish these concepts. I was planning to wait until w3c/csswg-drafts#5433 had been resolved before making this refactor. However, this will likely clean up other areas that will make things like a forced colors devtools emulation cleaner to implement. This will be easy enough to update once the above issue has been resolved (if needed). _________________________________ To explain the distinction of high contrast/preferred contrast/forced colors mode in a bit more detail: - High contrast in most cases triggers a preferred contrast of "more". - Since we are tracking the preferred contrast in NativeTheme, we can remove the redundancy of also tracking if we are in high contrast. - On Windows, high contrast is a bit different in that it also triggers what we call forced colors mode. In forced colors mode, the preferred contrast level may be "more" or "less" depending on which foreground and background colors are being forced. Thus, we also need to track the forced colors state in NativeTheme to detect cases of Windows high contrast that are not considered more or less contrast, but some contrast level in between. _________________________________ This CL should not result in any functional changes. Bug: 1157686,1107431
Chromium change: https://source.chromium.org/chromium/chromium/src/+/f64b910afa793bde5f50bf88c5b584007ffc68bd commit f64b910afa793bde5f50bf88c5b584007ffc68bd Author: Alison MaherDate: Tue Jan 5 17:02:46 2021 +0000 Refactor contrast tracking in NativeTheme In CL:2412972, it was recommended to split out the concepts of high contrast and forced colors mode inside NativeTheme. Doing so allows us to remove the |is_high_contrast_| variable in favor of |preferred_contrast_|. This also adds a |forced_colors_| variable to distinguish these concepts. I was planning to wait until w3c/csswg-drafts#5433 had been resolved before making this refactor. However, this will likely clean up other areas that will make things like a forced colors devtools emulation cleaner to implement. This will be easy enough to update once the above issue has been resolved (if needed). _________________________________ To explain the distinction of high contrast/preferred contrast/forced colors mode in a bit more detail: - High contrast in most cases triggers a preferred contrast of "more". - Since we are tracking the preferred contrast in NativeTheme, we can remove the redundancy of also tracking if we are in high contrast. - On Windows, high contrast is a bit different in that it also triggers what we call forced colors mode. In forced colors mode, the preferred contrast level may be "more" or "less" depending on which foreground and background colors are being forced. Thus, we also need to track the forced colors state in NativeTheme to detect cases of Windows high contrast that are not considered more or less contrast, but some contrast level in between. _________________________________ This CL should not result in any functional changes. Bug: 1157686,1107431
We didn't get to this in the F2F last week, but I agree with the core of @cookiecrook's argument - I don't think there is strong evidence for the boolean form of As anecdata, I also ran across this blog post that expresses some of the same sentiments: Also, if this does become a larger problem in practice, we would have the option of re-adding the value, whereas removing it would be more difficult. Another option (either now, or if the boolean usage ends up being problematic) would be always mapping forced colors mode to |
FYI @astearns added this on the agenda for tomorrow's CSS meeting at your local time. |
Going to gather some data on user-set (or platform-inhereted) contrast ratios in firefox :) |
The CSS Working Group just discussed
The full IRC log of that discussion |
Fixed through a2f6a35 (and d7b7f4b for typos), so closing. @cookiecrook, I'd appreciate if you could confirm being satisfied with this edit. |
Note APA is just waiting for signoff from @cookiecrook before closing in our tracker. |
@cookiecrook we had a resolution, so I went ahead without a pull request. a2f6a35 is indeed the only substantive commit. I'll respond to your two comments. |
Uh oh!
There was an error while loading. Please reload this page.
[mediaqueries-5] duplication of
forced-colors: active
andprefers-contrast: forced
Breaking this discussion out of the large mega thread in #2943.
I believe these statements are true.
forced-colors: active
andprefers-contrast: forced
are exact duplications of each other.forced-colors
is already implemented in Edge (and possibly in the Chrome HC extension.)Opinions:
forced
value is intended as a replacement for theforced-colors
media feature, and I've also heard that these are intended to be complementary and co-exist. Which is it, and why?forced
value intoprefers-constrast
is unnecessarily limiting. Another platform (iOS, Mac, ChromeOS, Android, Linux) may support a different forced mode in the future, andforced-colors
would be easier to extend.Editorial:
prefers-contrast: forced
cross-link toforced-colors: active
an confirms the duplication. If both are kept, the reciprocal link and explanatory prose should be added, too.The text was updated successfully, but these errors were encountered: