-
Notifications
You must be signed in to change notification settings - Fork 665
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][mediaqueries-5] Fold forced-colors
and prefers-contrast
?
#3856
Comments
More info on forced colors mode, for anyone who's dropping into the issue without context: discussion in #3807 on MSFT proposal yielding current spec text. |
Wondering also how Basically, I think it'd be nice if authors could have very clear triggers for when to make what adjustments, and if we could make those triggers as simple and straightforward as possible as media queries, and incorporate that authoring advice into the spec. |
I don't think we should be confusing Now, it may make sense to combine I do think web browsers should automatically update the ("correctly" being the key point. WHCM can't even figure out if my custom color scheme is dark-on-light or light-on-dark & doesn't give me any way to specify it — it's a hidden setting based on whichever built-in color scheme you started with before you customized it. grumble grumble grouch…)
This, I very much agree with. |
I believe this is WONTFIX due to Web-compat at this point regardless of any merits the proposal may have had last year. :/ Agenda+ to check. |
I suppose we could add |
The CSS Working Group just discussed
The full IRC log of that discussion<dael> Topic: [css-color-adjust-1][mediaqueries-5] Fold `forced-colors` and `prefers-contrast`?<dael> github: https://github.com//issues/3856 <dael> fantasai: I think we're not going to fold them b/c due to web compat we need to keep forced color MQ. <dael> fantasai: Could add it to trigger when forced-colors is active so you can know if there is a contrast requirement in place. <dael> emilio: Who ships prefers-contrast? MS? <dael> Rossen_: yes <dael> florian: Not convinced this can work. With prefers you're supposed to pick. With forced it's done for you. Knowing something is changed doesn't tell you want to do <Rossen_> q? <dael> fantasai: People will likely want to not use gradients or other content layering. Pull back effects with visual complexity. Those changes which aren't colors are things you'd want with low, high and forced contrast <dael> Rossen_: Synergy between forced-colors and the other prefer properties makes sense for same reason we made initial change for prefers color scheme. Seems reasonable based on forced-color mode people can allow the effect of forced-colors on large parts of content while providing reasonable experience either for contrast or adjust for appropriate color scheme. <AmeliaBR> q+ <fantasai> I'm suggesting we make @media (prefers-contrast) { ... } handle high, low, and forced contrast mods <fantasai> s/mods/modes/ <dael> Rossen_: I would argue for this change for similar reasons fantasai pointed out but also to underline that being able to escape large parts of content and do your own thing is important for this feature. <dael> Rossen_: I think the current contrast hint is missing here and if people do more with prefers-contrast this is a nice addition <dael> AmeliaBR: I would argue opposite. Important to keep independent. Forced-color mode can force low-contrast. It' snot common. If we treat forced as prefers-contrast people will assume it means high contrast when it's not true. Keeping them independent options recognizes it's more <florian> I started skeptical, but I now support the proposal <dael> fantasai: prefers-contrast also can ack. low contrast. forced-colors says I want a particular contrast. Adding it to prefers-contrast add a preference be it high or low. That's why I think it's appropriate. <dael> AmeliaBR: How works in authoring boolean perspective? Forced-colors is independent and media prefers-content doesn't match? <fantasai> https://drafts.csswg.org/mediaqueries-5/#prefers-contrast <dael> fantasai: We add a kewyrod of forced to prefers-contrast. If you use it without anything it means you have a preference be it high or low and the author should respond <fantasai> prefers-contrast: no-preference | high | low <fantasai> proposed to make that <fantasai> prefers-contrast: no-preference | high | low | forced <dael> florian: Author you can query to prefers-contrast high o prefers-contrast forced and with forced you can reduce visual complexity <dael> AmeliaBR: With that I'm okay with prop. Need clear authoring guidance to not assume it's in a specific direction <dael> astearns: I'm hearing support <dael> astearns: Obj to add the forced value to prefers-contrast? <AmeliaBR> s/it's/the preference is/ <fantasai> The fact that 'low' and 'high' both exist as values makes that pretty obvious imho <dael> RESOLVED: add the forced value to prefers-contrast |
How is See more in #2943. |
Also, the WG minutes mention @AmeliaBR asked:
But I don’t see that question answered in the minutes. What was the response? I have a boolean proposal in #2943 that I think could work across platforms, but adding |
I turns out this was already sort of defined. Using Which doesn't prevent adding an |
Something I thought about after the call: The As the spec is currently defined, an author could identify that the browser is in forced colors mode, and then use a mix of the /** pick a syntax scheme, these should cover all possible combinations **/
@import url(solarized-light.css) (prefers-contrast: low) AND (NOT (prefers-color-scheme: dark));
@import url(solarized-dark.css) (prefers-contrast: low) AND (prefers-color-scheme: dark);
@import url(high-contrast-light.css) (NOT (prefers-contrast: low)) AND (prefers-color-scheme: light);
@import url(high-contrast-dark.css) (NOT (prefers-contrast: low)) AND (NOT (prefers-color-scheme: light));
code.highlight {
forced-color-adjust: none;
/* always use the syntax highlighting colors for highlighted code */
} With One option would be to treat the query values as non-exclusive categories. So both So maybe a better compromise would be to add a |
I think it would be problematic to have |
Also, as there is no existing native implementation of a low contrast feature that I am aware of, in what scenario would any browser match |
If the author wants to evaluate against high contrast, they can write |
That negates the usefulness of this feature, since Update to clarify. In my original proposal for this contrast media feature, the goal was to make the authoring syntax boolean 99% of the time, as simple as possible... @media (prefers-contrast) { } But by folding forced colors and low contrast into the boolean match, now the simplest correct syntax for the most common scenario is this: @media (prefers-contrast: high) or (prefers-contrast: increase) { } And it's now much more likely that an author will forget one or the other, which excludes entire platforms... |
I understand this, and I was heavily involved in defining this behavior with The
But now with name change and the addition of
IMO, |
Should |
Microsofts proprietary media features for this were non-exclusive... For example, they could specify both high contrast and forced colors individually: high contrast black-on-white vs high contrast white-on-black among more. |
That's a good description of what Windows High-Contrast mode allows users to do. The actual colours aren't always an extremely high contrast. The pre-set colour palettes provided all have very high-contrast, but the feature allows users to specify their own palette. So it's possible to use Windows "high-contrast" mode to specify your own very low contrast palettes. Light brown on beige, for example. |
All the more reason to keep the |
@cookiecrook Your example in #3856 (comment) doesn't work because you're assuming that |
@fantasai wrote:
The spec proposes Meanwhile, macOS and iOS both have a "non-high-contrast-but-increased-contrast" mode (first shipped in iOS 7, over 8 years ago) that the CSS MQ5 spec does not account for. If those platforms ever ship a true "high" contrast mode, the current syntax of the media feature would become incompatible, because it doesn't allow that future flexibility. Adding forced colors into the mix makes the authoring syntax even more complicated. The preferable, simple boolean: @media (prefers-contrast) { } Would become this at minimum: @media (prefers-contrast: high) or (prefers-contrast: increase) { } I don't think the most common use case should be so verbose. We're crossing into the other issue a bit, so instead of going into more detail here, I'll point across to the proposal in #2943 (comment). |
@fantasai Is there any reason we shouldn't map to |
One benefit of keeping
To me, that's a useful distinction, because it provides direction about how I can best help the user. |
I don't understand why you consider that this increased contrast node should not match The definition is:
Seems to me it would be perfectly fine for the macOS/iOS mode to match that, and I am not quite sure what difference you seen between "increased contrast" and "a higher level of contrast". Could you explain a bit more? |
As @cookiecrook noted in a #3856 (comment) or #3856 (comment), the scope of this issue is overflowing into a related but distinct topic. The question asked by @fantasai initially has been resolved on, and I've made the edits, so I am closing this issue. For discussion of whether the Some comments have also suggested that maybe If, as a result of these discussions, we end up changing how this media feature works, we may end up deciding to reopen this issue. But it seems to me that quite a few points that @cookiecrook makes here assume that #2943 will be resolved in the direction he proposes, while the resolution that was recorded here assumes currently specified behavior. This is not an attempt to stifle discussion, but to consolidate each topic in their respective issue, and hopefully make the discussion easier to follow. |
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
@cookiecrook APA wants to know if you're ok with the disposition of this comment. |
…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
Was trying to work out authoring advice for responding to forced-colors mode and drafted up
But what I noticed is that this advice is probably also applicable any time
(prefers-contrast)
is true (i.e. when it islow
orhigh
but notno-preference
). Which made me wonder ifforced-colors: active
should instead beprefers-contrast: forced
?The text was updated successfully, but these errors were encountered: