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

I think I should resurface one thing I said near the end of the call: there *is* a hole in functionality here. Author-level design tokens (aka custom properties set on root and referenced via `var()`) work *differently* from system colors, even if we say that system colors are internally defined with `light-dark()`, because *using* a system color resolves it against the using element's color-scheme, while using a design token still has it resolve against the *root element*.

This is, of course, why not giving your custom property a syntax "works"; it forces the value to stay unresolved at definition time, and only when it's used in something with a syntax (like a built-in property) does it resolve into whatever it happens to be. But then you lose the features that having a syntax brings you, like syntax validation and animation.

We could define a third state, between "no syntax" and the current syntax behavior, where the syntax is used for *some* things, but the value is left "unresolved" until it's actually used (like an unregistered property). This would give the system color behavior.

It would come with some limitations, tho. The value *would* be, essentially, unresolved, so you wouldn't be able to usefully animate the custom property. (But you could still animate whatever property you used it in, of course, again just like system colors.)  That might be it?

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


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

Received on Thursday, 14 May 2026 21:25:13 UTC