Re: [csswg-drafts] [css-color-5] What should the behavior of the CSS Color 5 color functions be when passed `currentcolor` as <color> (#6168)

Sorry I missed this ping before.

@weinig @tabatkins resolving these at computed value time would break `currentcolor` when inheriting.

My point is that something like `color-mix(in lch, currentcolor 40%, palegoldenrod)` should somehow preserve the `currentcolor` component in the computed value, otherwise descendants that change `color` will get the wrong color.

Here's a test-case that shows what I meant. The expected output is greenish, but if you resolve `currentColor` at computed-value time, then you will get red.

I think Firefox's behavior is correct here (WebKit doesn't support `color-mix(..., currentColor, ...)` afaict)?

```html
<!doctype html>
<style>
  div {
    width: 100px;
    height: 100px;
  }
  .outer {
    background-color: color-mix(in srgb, currentcolor 90%, red 10%);
    color: red;
  }
  .inner {
    background-color: inherit;
    color: green;
  }
</style>
<div class="outer">
  <div class="inner"></div>
</div>
```

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


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

Received on Thursday, 12 August 2021 20:23:03 UTC