Re: [csswg-drafts] [css-color] [css-color-adjust] Make system colors fully resolve (but flag they were system colors) thus reversing the resolution of #3847 (#6773)

**Overview**

The key question here is whether system color keywords compute to an absolute color, and inherit as such, or whether they remain keywords and resolve at used-value time. My takeaway from the WG discussion was that the hangup here is, “which one results in more authoring mistakes?”

The two examples to think about are how this is impacted by `color-scheme` and `forced-color-adjust` changes specified by an author on a descendant of the root.

**Color Scheme Example**

Emilio's example in the OP, showing the effects of author-specified `color-scheme` changes:
```
<!doctype html>
<style>
  :root { color-scheme: dark } /* light text, dark background */
  span { color-scheme: light } /* dark text, light background */
</style>
I'm dark, and <span>I'm light</span>.
```

In this case the body text is light on a dark background. If system colors compute to absolute before inheriting, then “I'm light” will be light text. Is this expected or unexpected, and will it cause more or fewer mistakes than if we resolved after inheritance (yielding dark text for the element with `color-scheme: light`)?

**Forced Colors Example**

The other example is about `forced-color-adjust`, and was brought up when we [originally decided](https://github.com/w3c/csswg-drafts/issues/4915) to make them resolve at used-value time:

```
<!doctype html>
<style>
  :root { color: black; background: white; }
  .special { forced-color-adjust: none; background: yellow; }
</style>
Author says I'm black on white.
<div class=".special">
  What color am I?
</div>
```

In this case, the text is black on white. If forced-colors mode is on, however, the text might be forced to be, e.g. white on black. But inside the “special” div, we've turned off forced-colors mode.

If system colors compute to absolute before inheriting, then in forced white-on-black mode “What color am I?” will be white. Is this expected or unexpected, and will it cause more or fewer readability problems than if we resolved after inheritance (yielding the original color, black)?

**Issue**

The proposed change is to make the system colors compute to absolute before inheriting. The existing spec is to have them resolve on the element to which they apply.


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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 17 March 2022 15:40:12 UTC