Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/presentation/ui/src/chat/shimmer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export function Shimmer({
style={
{
backgroundImage:
'linear-gradient(90deg, transparent 35%, var(--color-background), transparent 65%), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))',
// --color-* are @theme-inline-only (no runtime custom properties); use the :root vars.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only guard against someone reintroducing the bug, so it's worth making it exact — as written it over-generalizes twice. Tailwind's default palette --color-* (--color-white, --color-zinc-500) comes from a non-inline @theme and does exist at runtime, which is precisely what globals.css:68 relies on; and the @theme inline aliases are emitted when a Tailwind-scanned candidate references them (coss-ui's skeleton.tsx:14 uses [background:…var(--color-muted)…] and gets a real custom property). The actual invariant is that a JS inline style string is never scanned, so nothing forces the alias to be emitted.

Technical details
# Trap comment states the wrong invariant

## Affected sites
- `packages/presentation/ui/src/chat/shimmer.tsx:30` — "`--color-*` are @theme-inline-only
  (no runtime custom properties)" is false for Tailwind's default palette and false for
  `@theme inline` aliases that a scanned candidate references.

## Required outcome
- The comment should name the real rule: Tailwind emits a theme variable only when
  something **it scans** references it via `var()`; a JS inline `style` string is not a
  scanned candidate, so coss-ui's semantic `--color-*` aliases never materialize on
  `:root` for this call site. Keep it to the repo's 1–2 line comment budget.

## Suggested approach
- Apply the inline suggestion, or any wording that distinguishes "not emitted here" from
  "never exists".

## Verification performed
- Compiled `tailwindcss@4.3.3` via its `compile()` API against a minimal repro of
  `packages/vendor/coss-ui/src/styles/globals.css`:
  - no candidates → `--color-muted:` absent from output
  - candidate `bg-muted` → still absent (value inlined into the utility)
  - candidate `[background:var(--color-muted)]`**present** in `:root`
  - `--color-white:` / `--color-zinc-100:` → present (non-inline default `@theme`)
Suggested change
// --color-* are @theme-inline-only (no runtime custom properties); use the :root vars.
// coss-ui's semantic --color-* aliases are @theme inline and Tailwind never scans a JS
// style string, so they are not emitted to :root — read the underlying vars directly.

'linear-gradient(90deg, transparent 35%, var(--background), transparent 65%), linear-gradient(var(--muted-foreground), var(--muted-foreground))',
backgroundRepeat: 'no-repeat',
} satisfies React.CSSProperties
}
Expand Down
Loading