Re: [csswg-drafts] [various] Holistic review/proposal of color-modifying things (#3807)

I am very intrigued by @FremyCompany's suggestion re using `revert` instead of the proposed cascade manipulation.

To clarify, this would mean that turning on a high contrast mode or other forced-color effect would have the following effects:

- Change the system colors (& make any extra changes to the user agent stylesheet that can't be handled just by system colors).
- Trigger the `forced-color` media condition.
- Set `forced-color-adjust: auto` on the document root (so it inherits into the whole document unless the other overrides it).  This could be represented by a conditional rule in the user agent stylesheet:
   ```css
   @media (forced-colors) {
     :root { forced-color-adjust: auto }
   }
   ```

From there, all values from the user agent and author stylesheet would cascade as normal.

_After_ cascade — and _separate_ from whether a high contrast mode is on or not — the `forced-color-adjust` property would have the following effects when it computes to `auto`:

- `revert` any author-specified values on the element for [the list of color-related properties](https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/master/HighContrast/explainer.md#css-properties)
- Add a solid-color text backplate (that matches the system background color) behind any text glyphs rendered for the element.

I do like this approach, especially if the existing `ms` media query can be made to work with it (with minimal magic).

I would suggest that `auto` is no longer the best keyword for something that causes a change by itself.  Maybe `forced-color-adjust: on` vs `off` makes more sense?  But then again, sticking with the `auto` and `none` keywords makes it easier to define the Microsoft `high-contrast-adjust` as a direct synonym.

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

Received on Wednesday, 10 April 2019 20:42:20 UTC