Re: [csswg-drafts] [css-color-adjust-1] Limits on the `only` color scheme keyword (#3881)

@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](https://drafts.csswg.org/css-color-adjust-1/#color-scheme-prop) to that effect:

> Authors **should not** use this value [`only`], and should instead ensure that their page renders well with whatever color scheme the user prefers (using the prefers-color-scheme media query to adjust styles accordingly). This keyword is provided only for the rare cases where that might not be reasonably possible, and using a different color scheme would render the element difficult or impossible to use.

But 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 https://github.com/w3c/csswg-drafts/issues/3299#issuecomment-463057095 ).

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 `only` modifier, I've stated my opinions above. In short: I'd rather have native widgets, in any color, than a poorly-implemented custom dropdown that can't be reached by the keyboard.

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](https://drafts.csswg.org/css-color-adjust-1/#forced). @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 `only` colour scheme declaration would not prevent switching to a forced colors mode. But if necessary for usability, authors could still opt out of adjustments with `forced-color-adjust`, which comes with [its own warnings in the spec](https://drafts.csswg.org/css-color-adjust-1/#forced-color-adjust-prop). Hopefully, misuse will be avoided because it's independent of the color scheme selection and is clearly defined as an accessibility override.

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

Received on Sunday, 5 May 2019 23:53:49 UTC