[csswg-drafts] [css-color] [css-color-adjust] Consider reversing the resolution of #3847 (#6773)

emilio has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-color] [css-color-adjust] Consider reversing the resolution of #3847 ==
In https://github.com/w3c/csswg-drafts/issues/3847 it was resolved that system colors would compute to themselves. The argument for that seems sensible (which is that color-scheme would be automatically honored for them while inheriting).

However I'm not so sure that's great behavior (plus there are still open issues from that change like https://github.com/w3c/csswg-drafts/issues/5780).

In particular, in order to guarantee contrast, you need to use system color _pairs_ (the foreground and the background), such as:

```html
div {
  background-color: Canvas;
  color: CanvasText;
}
```

If color-scheme changes, but the author _doesn't_ specify a background, making system colors compute to themselves at computed-value time breaks contrast ([rendered](http://crisal.io/tmp/color-scheme-change-no-background.html)):

```html
<!doctype html>
<style>
  :root { color-scheme: dark }
  span { color-scheme: light }
</style>
I'm dark, and <span>I'm light</span>
```

The `span` should be dark text over dark background per spec, since it inherits the initial color which is `canvastext`, which is undesirable.

That's clearly not how browsers are working today, which confuses me because I thought Chrome implemented this change.

I'd expect this test-case to render per spec the same as the following ([rendered](http://crisal.io/tmp/color-scheme-change-no-background-explicit-color.html)):

```html
<!doctype html>
<style>
  :root { color-scheme: dark }
  span { color-scheme: light; color: CanvasText }
</style>
I'm dark, and <span>I'm light</span>
```

(which is clearly undesirable, and not what's going on).

Can you explain what's going on here @futhark / @andruud / @kbabbitt / @tabatkins?

cc @smfr

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6773 using your GitHub account


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

Received on Wednesday, 27 October 2021 23:33:45 UTC