Re: [csswg-drafts] [css-color-5] Add `currentBackgroundColor` Variable (#5292)

I think lots of complexity comes from the fact that currentcolor is complicated to handle as it's a computed-value-time keyword for inheritance and interpolation. If we can avoid messing up with that, things may be a lot simpler.

I'm thinking about maybe we can just accept property name as variable in `var()` function, and have it resolved in a similar way as variables, e.g. after resolving CSS-wide keywords in specified values but before computation. That should address the use cases and keep the decoupling characteristic, but more extendable and possibly less complicated as we would be able to actually resolve things during computation rather than having to handle them post that. There are some trickiness we may need to think about carefully, though, like how inherited values are handled, as well as shorthands.

With that, `currentcolor` and `var(color)` would differ in the following ways:
1. `color: var(color)` would be invalid at computed-value-time because of cycle,
2. `var(color)` would not follow animation on `color` property as it's resolved on computed time,
3. another property inheriting `var(color)` would use the actual color from its parent rather than the fact that it follows `color` property of the current element.

But I don't think they matter for your usecase. WDYT?

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


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

Received on Wednesday, 11 November 2020 15:32:40 UTC