Re: [csswg-drafts] [css-color] Support using "inherit" in color-mix() (#8872)

This can be covered by #2864 (but for now it may be restricted to custom properties).

Worth noting that `border-color` is a shorthand, so something like this seems safer:

```css
    border-top-color: color-mix(in oklab, inherit(border-top-color) 70%, black);
    border-right-color: color-mix(in oklab, inherit(border-right-color) 70%, black);
    border-bottom-color: color-mix(in oklab, inherit(border-bottom-color) 70%, black);
    border-left-color: color-mix(in oklab, inherit(border-left-color) 70%, black);
```

Doing the expansion automatically seems tricky. I guess the process would be like:
 1. Treat `inherit()` as a `<color>`
 2. Do longhand expansion normally
 3. Each longhand receiving `inherit()` resolves it to that same longhand (not the shorthand).

but what if the shorthand has longhands that don't compute to a `<color>`? Like

```css
    border: 5px solid color-mix(in oklab, inherit() 70%, black);
```

some longhands like `border-top-width` compute to a length instead of to a color. Of course using a length there wouldn't be valid syntax, but in general we could get ambiguous situations. So how do we know `inherit()` should be treated as a `<color>`?




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


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

Received on Thursday, 25 May 2023 07:40:59 UTC