Re: [csswg-drafts] [css-color-5] `light-dark()` should resolve at used value time, not computed value time (#13836)

> Is this **desirable**?

I am not sure, at least as a default. Personally, my mental model for registered custom properties right now is that they _capture_ their value when you assign any value to them, and in my use cases even resolving `currentColor` at used time was undesirable. And I can easily see the footgun that Emilio mentioned happening in practice as well.

However, I can understand use cases, but I wonder if this could be an _extension_ of registered custom properties, like a separate option like `captures` (to be consistent with `inherits`) that controls whether they capture their value or not. So by default it would work as it does right now, but you could add something that will then pass the value as a string of tokens, although first it would also validate it for correctness with `syntax`.

Basically,

```
@property --color-accent {
 syntax: "<color>";
 initial-value: skyblue;
 inherits: true;
 captures: false;
}
```

And then it will behave as proposed?

> Is it **web compatible**?

Other than just inheritance, it will also break any container style queries that could've relied on the current behavior as a way to query the `color-scheme` value; see https://blog.kizu.dev/querying-the-color-scheme/ for an example.


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


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

Received on Wednesday, 13 May 2026 07:50:58 UTC