W3C home > Mailing lists > Public > public-css-archive@w3.org > October 2020

Re: [csswg-drafts] [css-color-adjust-1] Is forced color computed or used value? (#4915)

From: Alison Maher via GitHub <sysbot+gh@w3.org>
Date: Tue, 20 Oct 2020 19:25:39 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-713086976-1603221937-sysbot+gh@w3.org>
I wanted to +1 @fantasai's point in the [above comment](https://github.com/w3c/csswg-drafts/issues/4915#issuecomment-707969753).

In particular, forcing at used-value time will likely be helpful for the following case:
```
<style>
  body {
    color: red;
  }
</style>
<body>
  <svg>
    <rect width="100" height="100" fill="white"/>
    <text x="0" y="15" fill="currentColor">Test</text>
  </svg>
</body>
```

We set `forced-color-adjust: none` on `SVG` elements in Forced Colors Mode. Thus, in the above example, when Forced Colors Mode is enabled to the white-on-black theme, the `SVG` rectangle will remain filled with `white`, but since the text `fill` is set to `currentColor`, it will become unreadable since it will inherit a white forced color from its parent.

If we were to force colors at used-value time, instead, the text fill would pick up `red` and would remain readable in Forced Colors Mode.

So although changing this to used-value time may complicate the implementation a bit, I do think that there is value in changing this to a used-value time operation.

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 20 October 2020 19:25:42 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:20 UTC