It passes the value sanitiser untouched — now pinned by a test, since had color-mix(... var(...) ...) been rejected as unsafe, derivation would have needed a storage shape of its own — and the browser resolves the var() at use time.
One declaration covers every mode. A derived token written once in the base layer follows its source through dark mode automatically, because var() resolves where it is used, not where it is written. A stored computed literal would need a row per mode and would stop tracking its source the moment the source changed.
What derivation did need is the check. A formula pointing at a missing token is invalid-at-computed-value-time: the browser drops the declaration and the token has no value, with nothing in the toolchain noticing. derivation_report returns which tokens are computed and from what, which formulas point at nothing, and which derive from each other in a loop. The UI leads with the broken ones — those are unambiguously wrong, where a duplicate value is a judgement call.
One commit, `1fde646`. CI green (run 3138). No migrations.
Storage needed no change: a formula is just a value.
--fs-accent-soft: color-mix(in srgb, var(--fs-accent) 15%, transparent)
It passes the value sanitiser untouched — now pinned by a test, since had `color-mix(... var(...) ...)` been rejected as unsafe, derivation would have needed a storage shape of its own — and the browser resolves the `var()` at use time.
**One declaration covers every mode.** A derived token written once in the base layer follows its source through dark mode automatically, because `var()` resolves where it is *used*, not where it is written. A stored computed literal would need a row per mode and would stop tracking its source the moment the source changed.
What derivation did need is the check. A formula pointing at a missing token is invalid-at-computed-value-time: the browser drops the declaration and the token has no value, with nothing in the toolchain noticing. `derivation_report` returns which tokens are computed and from what, which formulas point at nothing, and which derive from each other in a loop. The UI leads with the broken ones — those are unambiguously wrong, where a duplicate value is a judgement call.
Operator: "build in a way to support formulas like this so that the colors shift
as expected and have less to clean up when testing color changes."
The storage needed no change at all, which is the good news. A formula is just a
value:
--fs-accent-soft: color-mix(in srgb, var(--fs-accent) 15%, transparent)
It passes the value sanitiser untouched (verified, and now pinned by a test —
had `color-mix(... var(...) ...)` been rejected as unsafe, derivation would have
needed a storage shape of its own), and the browser resolves the `var()` at use
time. Change `--fs-accent` and everything derived from it shifts.
**One declaration covers every mode**, and that is the "less to clean up" part.
A derived token written once in the base layer follows its source through dark
mode automatically, because `var()` resolves where it is USED rather than where
it is written. A stored computed literal would need a row per mode and would
silently stop tracking the source the moment the source changed — the whole
problem this avoids.
What derivation DID need is the check. A formula pointing at a token that does
not exist is invalid-at-computed-value-time: the browser drops the declaration
outright and the token has no value. No error, no warning, nothing in the
toolchain notices — the same family as `--color-accent`, `_parent_map`, and the
scripted edit whose anchor matched nothing.
So `derivation_report` returns three things alongside the sheet: which tokens are
computed and from what, which formulas point at nothing, and which derive from
each other in a loop. CSS resolves a loop to nothing rather than hanging, so the
cycle check is about telling the operator, not protecting the renderer — but a
token that quietly resolves to nothing is exactly what is worth being told.
A self-reference with a fallback (`var(--fs-x, 8px)`) is deliberately not a
dependency; counting it would report every such token as a one-node loop.
The UI leads with broken formulas, then loops, then the healthy derived set —
the first two are unambiguously wrong, where a duplicate value is a judgement
call.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
One commit,
1fde646. CI green (run 3138). No migrations.Storage needed no change: a formula is just a value.
It passes the value sanitiser untouched — now pinned by a test, since had
color-mix(... var(...) ...)been rejected as unsafe, derivation would have needed a storage shape of its own — and the browser resolves thevar()at use time.One declaration covers every mode. A derived token written once in the base layer follows its source through dark mode automatically, because
var()resolves where it is used, not where it is written. A stored computed literal would need a row per mode and would stop tracking its source the moment the source changed.What derivation did need is the check. A formula pointing at a missing token is invalid-at-computed-value-time: the browser drops the declaration and the token has no value, with nothing in the toolchain noticing.
derivation_reportreturns which tokens are computed and from what, which formulas point at nothing, and which derive from each other in a loop. The UI leads with the broken ones — those are unambiguously wrong, where a duplicate value is a judgement call.Operator: "build in a way to support formulas like this so that the colors shift as expected and have less to clean up when testing color changes." The storage needed no change at all, which is the good news. A formula is just a value: --fs-accent-soft: color-mix(in srgb, var(--fs-accent) 15%, transparent) It passes the value sanitiser untouched (verified, and now pinned by a test — had `color-mix(... var(...) ...)` been rejected as unsafe, derivation would have needed a storage shape of its own), and the browser resolves the `var()` at use time. Change `--fs-accent` and everything derived from it shifts. **One declaration covers every mode**, and that is the "less to clean up" part. A derived token written once in the base layer follows its source through dark mode automatically, because `var()` resolves where it is USED rather than where it is written. A stored computed literal would need a row per mode and would silently stop tracking the source the moment the source changed — the whole problem this avoids. What derivation DID need is the check. A formula pointing at a token that does not exist is invalid-at-computed-value-time: the browser drops the declaration outright and the token has no value. No error, no warning, nothing in the toolchain notices — the same family as `--color-accent`, `_parent_map`, and the scripted edit whose anchor matched nothing. So `derivation_report` returns three things alongside the sheet: which tokens are computed and from what, which formulas point at nothing, and which derive from each other in a loop. CSS resolves a loop to nothing rather than hanging, so the cycle check is about telling the operator, not protecting the renderer — but a token that quietly resolves to nothing is exactly what is worth being told. A self-reference with a fallback (`var(--fs-x, 8px)`) is deliberately not a dependency; counting it would report every such token as a one-node loop. The UI leads with broken formulas, then loops, then the healthy derived set — the first two are unambiguously wrong, where a duplicate value is a judgement call.