You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #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 #5780).
In particular, in order to guarantee contrast, you need to use system color pairs (the foreground and the background), such as:
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):
<!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):
<!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).