Fix phantom CSS var() refs across the shell renderer + close the check gap#151
Merged
Conversation
…rd against regression
The shell renderer CSS was deliberately excluded from `check-css-tokens.mjs`
(`CSS_SCOPES` covered apps/sdk/editor only), so `var(--x)` names that don't
resolve to any real theme token fell back silently — the wrong font, or (for
the no-fallback cases like `background: var(--color-surface-2)`) no background
at all. This is the same class of bug as the Identity fingerprint's phantom
`--font-mono` (it rendered in the UI font, not code).
Swept every `packages/shell/src/renderer/**/*.css` reference to a real token:
- `--font-mono` / `--font-family-mono` / `--font-family-sans` → `--text-family-code` / `--text-family-ui`
- `--color-surface{,-1,-2,-3,-sunken,-muted,-subtle,-secondary,-tertiary}` → real `--color-surface-{default,raised,overlay}`
- `--color-surface-hover` → `--color-interactive-hover`
- `--color-text-danger` / `--color-text-on-accent` / `--color-on-accent` → `--color-state-error` / `--color-text-inverse`
- subtle state backgrounds (`--color-state-*-subtle`, `--color-state-warn-bg`, `--color-state-highlight`) → `color-mix(... var(--color-state-*) N%, transparent)` (existing shell pattern)
- `--focus-ring` → `2px solid var(--color-focus-ring)`; `--shadow-overlay` → `--shadow-xl`
- `--line-height-relaxed` → `--text-line-height-relaxed`; `--space-1-5` → `--space-2`
- `--z-windowControlsOverlay` → `--z-window-controls-overlay` (casing)
- dropped dead phantom fallbacks (`--color-background-secondary`, `--color-selection-subtle`)
Then added `packages/shell/src/renderer` to `CSS_SCOPES` so the check now covers
the shell renderer too — a phantom there can't silently ship again.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
The shell renderer CSS was excluded from
tools/check-css-tokens.mjs(CSS_SCOPESonly coveredapps/sdk/editor). So avar(--x)naming a token that doesn't exist fell back silently:font-family: var(--font-mono, monospace)→ the UI font, not code — the exact bug behind the Identity fingerprint looking off), andbackground: var(--color-surface-2)→ the declaration is invalid → transparent). Several settings/marketplace/feedback panels were rendering with missing surfaces.Fix
Mapped 46 references (24 distinct phantom names) across
packages/shell/src/renderer/**/*.cssto real tokens (packages/tokens), verified against the actual palette rather than guessing:--font-mono,--font-family-mono,--font-family-sans--text-family-code/--text-family-ui--color-surface{,-1,-2,-3,-sunken,-muted,-subtle,-secondary,-tertiary}--color-surface-{default,raised,overlay}--color-surface-hover--color-interactive-hover--color-text-danger,--color-text-on-accent,--color-on-accent--color-state-error/--color-text-inverse--color-state-*-subtle,--color-state-warn-bg,--color-state-highlightcolor-mix(… var(--color-state-*) N%, transparent)(existing shell pattern)--focus-ring2px solid var(--color-focus-ring)--shadow-overlay--shadow-xl--line-height-relaxed--text-line-height-relaxed--space-1-5--space-2--z-windowControlsOverlay--z-window-controls-overlay(casing)Dead phantom fallbacks (
--color-background-secondary,--color-selection-subtle) dropped.Regression guard
Added
packages/shell/src/renderertoCSS_SCOPES— the check now covers the shell renderer, so a phantom there fails CI instead of shipping.bun tools/check-css-tokens.mjs→ ✓ everyvar()resolves.🤖 Generated with Claude Code