Repository navigation
fix(web): repair transition durations dropped as invalid CSS - #810
Merged
Merged
Conversation
Tailwind v3 spelled a custom property inside an arbitrary value as
`[--token]`. Under v4 that is read as a bare token, so
`duration-[--duration-fast]` compiled to
transition-duration: --duration-fast
which is not valid CSS. Browsers drop the declaration and the utility
falls back to `0s`, so eighteen transitions across the carousels, the home
hero, the audiobook group view and the setup wizard were not animating at
all. The v4 spelling `duration-(--duration-fast)` emits `var(--token)`.
Verified against the production bundle: it previously contained
`transition-duration:--duration-fast`, `:--duration-normal` and
`:--duration-slow`, and now contains no bare-token duration at all.
A missing transition looks like a design choice rather than a bug, in
review and in the browser alike, so this adds a contract test over the
source rather than trusting the next reader to catch it. That test
immediately found a second instance the mechanical sweep had missed —
`ease-[--ease-smooth]` in the design-system docs, a different utility with
the same failure mode.
Ports the Tailwind syntax fix from #805 by @blurbery, rebuilt against main.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Same failure as the duration tokens, one step further along: Tailwind only
keeps a theme variable whose name it can find in the scanned source, and
this one was assembled from a template literal —
animation: `var(--animate-ken-burns-${i % 2 === 0 ? "a" : "b"})`
so neither `--animate-ken-burns-a` nor `-b` ever appeared as literal text.
Both were tree-shaken out of the bundle, `var()` resolved to nothing, and
the `animation` shorthand was invalid, so the hero has never actually
panned. The only values that reached the bundle were the `none` overrides
from the `prefers-reduced-motion` block.
Naming both literally restores the effect; the reduced-motion overrides
still apply, so this stays accessible.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Contributor
|
Warning Review limit reachedNext included review available in 56 minutes. View limit detailsLimit details: You’ve used the included review currently available. Your 100 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
Comment |
2 tasks done
1 of 2 tasks
2 tasks done
Quick104
pushed a commit
that referenced
this pull request
Sep 22, 2026
Seven of the ten declarations in the `html[data-high-contrast="true"]`
block referenced themselves:
--border: color-mix(in srgb, white 34%, var(--border));
Per CSS Custom Properties L1 §3 a custom property whose value references
itself is in a dependency cycle and is invalid at computed-value time, so
the declaration is discarded and the token computes to nothing. This holds
even though an inherited value exists — the inherited value is not
consulted — so the intended mix never resolved.
Measured on a live instance (midnight-cinema, Chrome), all seven
self-referencing tokens computed empty while the non-self-referencing
`--foreground` and `--ambient-glow-opacity` applied correctly.
Two things went wrong as a result, and both made high contrast *worse*
than standard mode:
- `--surface` was invalid, so .surface-panel / .surface-panel-subtle /
.surface-panel-raised computed `background-color: rgba(0,0,0,0)` and
rendered transparent — settings panels, cards and popovers became
flat holes on the page background.
- `border-color` fell back to `currentColor`, and the same block sets
`--foreground: #ffffff`, so borders rendered pure white instead of
`rgb(40, 40, 46)`.
The fix gives the mix an input that is not the property being assigned.
Each theme now defines the literal under `--<token>-base`, the semantic
token is an alias, and high contrast mixes from the base. Verified
against the compiled output in a real document root: all seven tokens
resolve both with high contrast off and on.
Worth recording that the intuitive alternative does not work — moving the
block to a descendant so `var()` inherits is still cyclic and still
computes empty. Only a distinct input token resolves.
`git log -L` traces the block unchanged to c085b12, so this never
worked. It likely went unreported because any profile with a stored
`ui.custom_theme_vars` override never sees it: those are injected
unlayered and win over this block.
Same failure family as #810 — CSS that parses fine, is discarded at
computed-value time, and surfaces only as a subtly wrong UI. Added
highContrastCss.test.ts as a contract test over app.css, in the shape of
navigationTransitionCss.test.ts: it fails the whole stylesheet on any
self-referencing custom property, and checks the mix, the aliases, and
that every theme defines every base token. Confirmed it fails when the
old declaration is reintroduced.
Co-Authored-By: Claude Opus 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Related issue: N/A — narrow fix found while reviewing #805.
Tailwind v3 spelled a custom property inside an arbitrary value as
[--token]. Underv4 that is read as a bare token, so
duration-[--duration-fast]compiles to:That is not valid CSS. Browsers drop the declaration and the utility falls back to
0s, so eighteen transitions onmaintoday are not animating at all — thecarousel arrows, the home hero crossfade and play pills, the audiobook group view,
NowListeningHero, and the setup wizard step indicator. The v4 spellingduration-(--duration-fast)emitsvar(--token).The second commit is the same failure one step further along.
HeroBannerbuilt itsanimation token name from a template literal:
animation: `var(--animate-ken-burns-${i % 2 === 0 ? "a" : "b"})`Tailwind only keeps a theme variable whose name it can find in the scanned source, so
neither
--animate-ken-burns-anor-bever appeared as literal text. Both weretree-shaken out of the bundle,
var()resolved to nothing, and theanimationshorthand was invalid — the home hero has never actually panned. The only values that
reached the bundle were the
noneoverrides from theprefers-reduced-motionblock.Approach
Convert the utilities to the v4 spelling and name the animation tokens literally.
Both failures are invisible in review and in the browser — a missing transition reads
as a design choice — so this adds a contract test over the source rather than trusting
the next reader to catch it. That test immediately found a third instance the
mechanical sweep had missed (
ease-[--ease-smooth]in the design-system docs), whichis a fair argument for it existing.
Validation
Verified against the production bundle rather than by eye:
transition-duration:--duration-fast|normal|slow--animate-ken-burns-a:noneken-burns-a 14s linear infinite+ the:nonereduced-motion overrideConfirmed live that a real hero reports
animationName: ken-burns-a,14s.pnpm run build— passedpnpm exec vitest run— 2610 passedpnpm run lint— 0 errors (165 pre-existing warnings, unchanged baseline)pnpm run format:check— passedReduced motion is unaffected:
app.cssstill overrides both animation tokens tonone, so the restored hero motion stays accessible.Risks
Eighteen transitions that were instant now animate, and the home hero now pans. That
is the intended repair, but it is a visible change to surfaces nobody has seen
animate, so it is worth a look rather than a rubber stamp.
Provenance
Ports the Tailwind syntax fix from #805 by @blurbery, rebuilt against current
main.That branch bundled this with a navigation rewrite and app-wide presentation changes;
this PR is the token fixes alone.
AI Disclosure
the product calls, and reviewed the result against a live deployment.
claim was not taken on trust from the source diff; it was confirmed by grepping the
compiled bundle before and after, and the Ken Burns claim was confirmed the same way
after an initial review finding about it turned out to be wrong (it was reported as
a removed working feature; it had in fact never worked). Both regressions are now
pinned by tests.
Checklist
🤖 Generated with Claude Code