Skip to content

fix(theme): regenerate theme-kumo.css to sync with config.ts#365

Open
singkia wants to merge 4 commits intocloudflare:mainfrom
singkia:fix/regenerate-stale-theme-css
Open

fix(theme): regenerate theme-kumo.css to sync with config.ts#365
singkia wants to merge 4 commits intocloudflare:mainfrom
singkia:fix/regenerate-stale-theme-css

Conversation

@singkia
Copy link
Copy Markdown
Contributor

@singkia singkia commented Apr 4, 2026

What

Regenerate theme-kumo.css by running pnpm codegen:themes to bring the committed CSS back in sync with the theme generator source of truth (scripts/theme-generator/config.ts).

Why

The committed theme-kumo.css was stale — it did not match what the theme generator produces from the current config.ts. This means any contributor who runs pnpm codegen will see unexpected dirty files in their worktree, even on a clean checkout.

Three specific issues:

  1. Stale tokens: --color-kumo-surface and a duplicate --color-kumo-recessed definition remained in the mode-scoped CSS blocks, despite being renamed/removed in config.ts (replaced by --color-kumo-canvas, --color-kumo-elevated, etc.)

  2. Wrong fallback value: --color-kumo-fill-hover dark mode referenced var(--color-neutral-700, ...) but config.ts specifies var(--color-neutral-800, ...) (the oklch value is the same, so no visual change, but the CSS variable reference was wrong)

  3. Token ordering: surface-related tokens were placed before badge tokens in the mode-scoped blocks, but the generator outputs them after badge tokens (following config.ts key insertion order)

Reproduction: on a clean checkout of main, run pnpm --filter @cloudflare/kumo codegen:themes and observe 23 lines of diff in theme-kumo.css.

Validation Checklist

  • Reproduced the issue: git checkout -- theme-kumo.csscodegen:themes → identical diff every time
  • theme-fedramp.css is unaffected (no diff)
  • No visual changes expected (stale tokens were being overridden by later declarations, and the oklch fallback values are identical)
  • Changeset included

AI disclosure

This PR was prepared with Amp. The agent identified the stale codegen output, reproduced the issue, and drafted the PR.

The committed theme-kumo.css was out of sync with the theme generator
config. Running `codegen:themes` produces a different output because:

1. Stale tokens: `--color-kumo-surface` and duplicate `--color-kumo-recessed`
   remained in the CSS despite being renamed/removed in config.ts
   (replaced by `--color-kumo-canvas`, `--color-kumo-elevated`, etc.)

2. Wrong fallback: `--color-kumo-fill-hover` dark value referenced
   `neutral-700` but config.ts specifies `neutral-800`

3. Ordering: surface-related tokens were placed before badge tokens
   in the mode-scoped blocks, but the generator outputs them after
   (following config.ts key insertion order)

Fix: re-ran `pnpm codegen:themes` and committed the result.
Amp-Thread-ID: https://ampcode.com/threads/T-019d58cd-b57b-75ac-9290-0f71d760fa4b
Co-authored-by: Amp <amp@ampcode.com>
@geoquant
Copy link
Copy Markdown
Collaborator

geoquant commented Apr 6, 2026

/bonk review

Copy link
Copy Markdown
Contributor

@ask-bonk ask-bonk bot left a comment

Choose a reason for hiding this comment

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

Review Summary

Verified - All three issues described in the PR are accurate and correctly fixed:

  1. Stale tokens removed: --color-kumo-surface and duplicate --color-kumo-recessed definitions correctly removed from mode-scoped blocks (these tokens don't exist in config.ts)

  2. Wrong fallback fixed: --color-kumo-fill-hover dark mode now correctly references var(--color-neutral-800, ...) instead of var(--color-neutral-700, ...), matching config.ts line 328

  3. Token ordering: Surface tokens now appear after badge tokens in mode-scoped blocks, matching the key insertion order in config.ts

Changeset: Correctly marked as patch - this is a no-op bug fix that brings auto-generated CSS back into sync with the source of truth.

Good fix - stale generated files are a real pain for contributors.

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk bot commented Apr 6, 2026

Review submitted and approved for PR #365.

I've verified all three issues described in the PR against the config.ts source of truth:

  1. Stale tokens — Confirmed --color-kumo-surface and duplicate --color-kumo-recessed definitions don't exist in config.ts and were correctly removed
  2. Wrong fallback — Verified kumo-fill-hover dark mode uses var(--color-neutral-800, ...) in config.ts (line 328), which the PR correctly applies
  3. Token ordering — Confirmed the PR reorders tokens to match config.ts key insertion order (badge tokens → surface tokens)

The changeset is correctly classified as a patch — this is a pure fix with no visual changes that prevents dirty worktrees for contributors running pnpm codegen:themes.

github run

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 7, 2026

npm i https://pkg.pr.new/@cloudflare/kumo@365

commit: 7649799

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Docs Preview

View docs preview

Commit: 7649799

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Visual Regression Report

22 screenshot(s) with visual changes:

Button / Basic

258 px (0.25%) changed

Before After Diff
Before After Diff

Button / Variant: Ghost

175 px (0.17%) changed

Before After Diff
Before After Diff

Button / Variant: Destructive

3,143 px (3.1%) changed

Before After Diff
Before After Diff

Button / Variant: Secondary Destructive

0 px (0%) changed

Before After Diff
Before After Diff

Button / Sizes

676 px (0.67%) changed

Before After Diff
Before After Diff

Button / With Icon

515 px (0.51%) changed

Before After Diff
Before After Diff

Button / Icon Only

72 px (0.07%) changed

Before After Diff
Before After Diff

Button / Loading State

8 px (0.01%) changed

Before After Diff
Before After Diff

Button / Disabled State

182 px (0.18%) changed

Before After Diff
Before After Diff

Dialog / Dialog With Actions

227 px (0.22%) changed

Before After Diff
Before After Diff

Dialog / Dialog Basic

199 px (0.2%) changed

Before After Diff
Before After Diff

Dialog / Dialog Alert

3,891 px (3.83%) changed

Before After Diff
Before After Diff

Dialog / Dialog Confirmation

3,663 px (3.61%) changed

Before After Diff
Before After Diff

Dialog / Dialog With Dropdown

130 px (0.13%) changed

Before After Diff
Before After Diff

Dialog (Open)

10,138 px (0.05%) changed

Before After Diff
Before After Diff

Select / Select Without Label

187 px (0.18%) changed

Before After Diff
Before After Diff

Select / Select With Field

808 px (0.69%) changed

Before After Diff
Before After Diff

Select / Select Placeholder

810 px (0.8%) changed

Before After Diff
Before After Diff

Select / Select Loading

2,288 px (1.06%) changed

Before After Diff
Before After Diff

Select / Select Multiple

801 px (0.79%) changed

Before After Diff
Before After Diff

Select / Select Complex

1,485 px (1.25%) changed

Before After Diff
Before After Diff

Select (Open)

1,215,450 px (7.62%) changed

Before After Diff
Before After Diff
9 screenshot(s) unchanged
  • Button / Variant: Primary
  • Button / Variant: Secondary
  • Button / Variant: Outline
  • Button / Title
  • Dialog / Dialog With Select
  • Dialog / Dialog With Combobox
  • Select / Select Basic
  • Select / Select With Tooltip
  • Select / Select Custom Rendering

Generated by Kumo Visual Regression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants