Skip to content

feat: glaze 1.2.0 + lightness→tone palette migration - #1267

Merged
tenphi merged 3 commits into
mainfrom
feat-glaze-1.2-tone-migration
Jul 30, 2026
Merged

feat: glaze 1.2.0 + lightness→tone palette migration#1267
tenphi merged 3 commits into
mainfrom
feat-glaze-1.2-tone-migration

Conversation

@tenphi

@tenphi tenphi commented Jul 29, 2026

Copy link
Copy Markdown
Member

Splits the non-pastel half of #1229 out, so the Glaze upgrade and the fixes riding on it can land without waiting on the postponed visual redesign.

Why the upgrade and the migration are one change

Glaze 1.x removed lightness as a color-def input. RegularColorDef now exposes tone, not lightness, so bumping Glaze forces all 54 palette declarations to be re-authored against the contrast-shaped tone axis. There is no way to take the upgrade without the migration.

⚠ This changes resolved colors

tone is contrast-shaped rather than lightness-shaped, so tokens do not land on their previous values. Measured per-channel RGB delta vs main, across every token in all four scheme variants:

group mean Δ max Δ
core surfaces / text ~13 51
accent (non-disabled) ~13 48
accent-disabled ~11 122 (recipe changed, see below)

Seed hue and saturation are unchanged, so hue relationships and relative ramps are preserved — the shift is in tone placement, not in the palette's structure.

What is deliberately excluded

The pastel migration stays in #1229: { pastel: true } on both theme seeds, and SEED_SATURATION 80 → 100.

Worth recording, because it is counter-intuitive: dropping pastel while keeping seed 100 moves accents further from main (mean Δ 43.7) than keeping pastel does (31.0) — the tone values were authored against pastel's hue-independent chroma boundary. Reverting the seed to 80 alongside is what brings the delta down to ~13. So this PR reverts both together or neither.

Also included

Previously blocked on the Glaze upgrade, or independent of it:

  • accent-disabled-surface-text authored as tone: 'max' (was lightness: '+1' + contrast: 1.51) — only viable from Glaze 1.2.0, which stopped re-mapping a based extreme through the dark tone window.
  • item-themes: selected labels move to the soft accent text token and intensify on hover.
  • Lazy Glaze token resolution (getPaletteTokens() / lazyStyles).
  • s2 / s3 / s4 monospace typography presets; PrismCode HTML support; CopySnippet + use-action fixes; new Colors stories/docs.

Size budget raised 445kB → 460kB (bundle is 451.31 kB). Note the tree-shaking budget is now the tighter one — 117.63 kB against 118 kB.

Verification

Build clean · 997 tests pass · oxlint + prettier clean · size-limit passes.

🤖 Generated with Claude Code


Note

High Risk
The Glaze upgrade and full-palette re-authoring change resolved colors app-wide (visual regression risk for consumers), while lazy token caching means host glaze.configure() must run before first token access.

Overview
Major design-token change: bumps @tenphi/glaze to 1.2.0 and rewrites palette.ts from lightness to contrast-shaped tone (including accent-selected-fill for accent text contrast, tone: 'max' on accent-disabled labels, and oklch export). Resolved colors shift across light/dark/HC (~mean Δ13 on core/accent tokens).

Lazy resolution: adds lazyStyles plus getPaletteTokens / getColorTokens / getTokens; TOKENS / COLOR_TOKENS / PALETTE_TOKENS stay as proxies so hosts can glaze.configure() before first paint. GlobalStyles calls getTokens().

Typography & code: new s2s4 monospace presets; PrismCode / CopySnippet default to s3; CopySnippet serif keeps non-mono font explicitly; restores #pink legacy alias; Prism global CSS gains HTML token rules (tags/attrs/values).

Item chrome: outline/clear selected labels use #primary-accent-text-soft, intensifying to #primary-accent-text on hover (aligned with links).

Docs & budget: new Colors Storybook reference; Usage/Typography docs updated; full bundle size limit 445kB → 460kB.

Reviewed by Cursor Bugbot for commit 9c260e1. Bugbot is set up for automated code reviews on this repo. Configure here.

Splits the non-pastel half of the redesign branch (#1229) out so the Glaze
upgrade and the fixes riding on it can land without waiting on the
postponed visual redesign.

Glaze 0.13.0 -> 1.2.0. Glaze 1.x removed `lightness` as a color-def input,
so the upgrade and the axis migration are inseparable: all 54 palette
declarations are re-authored against the contrast-shaped `tone` axis.

This DOES change resolved colors — `tone` is contrast-shaped, not
lightness-shaped, so tokens do not land on their previous values. Measured
per-channel RGB delta vs main across every token in all four scheme
variants: core surfaces/text mean ~13 (max 51), accent mean ~13 (max 48).
Seed hue and saturation are unchanged, so hue relationships and relative
ramps are preserved; the shift is in tone placement.

Deliberately EXCLUDED (stays in #1229, the visual redesign): the pastel
migration — `{ pastel: true }` on both theme seeds and `SEED_SATURATION`
80 -> 100. Worth recording why, because it is counter-intuitive: dropping
`pastel` while keeping seed 100 moves accents FURTHER from main (mean 43.7)
than keeping pastel does (31.0), because the tone values were authored
against pastel's hue-independent chroma boundary. Reverting the seed to 80
alongside is what brings the delta down to ~13.

Also included, all previously blocked on the Glaze upgrade or independent
of it:
- `accent-disabled-surface-text` authored as `tone: 'max'` (was
  `lightness: '+1'` + `contrast: 1.51`) — only viable from Glaze 1.2.0.
- item-themes: selected labels move to the soft accent text token and
  intensify on hover.
- Lazy Glaze token resolution (`getPaletteTokens()` / `lazyStyles`).
- `s2`/`s3`/`s4` monospace typography presets; PrismCode HTML support;
  CopySnippet + use-action fixes; new Colors stories/docs.

Size budget raised 445kB -> 460kB (bundle is 451.31 kB).

Verified: build clean, 997 tests pass, oxlint + prettier clean, size-limit
passes.
@changeset-bot

changeset-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9c260e1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cube-dev/ui-kit Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cube-ui-kit Ready Ready Preview Jul 30, 2026 8:23am

Request Review

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

📦 NPM canary release

Deployed canary version 0.0.0-canary-c64b528.

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

🧪 Storybook is successfully deployed!

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

🏋️ Size limit report

Name Size Passed?
All 440.76 KB (+1.56% 🔺) Yes 🎉
Tree shaking (just a Button) 114.88 KB (+0.01% 🔺) Yes 🎉

Click here if you want to find out what is changed in this build

Comment thread src/tokens/colors.ts
Comment thread src/components/content/CopySnippet/CopySnippet.tsx
Both from review on #1267, both verified against main before fixing.

#pink — the legacy alias was dropped from LEGACY_ALIASES while
`tasty.config.ts`, `Usage.docs.mdx`, the `colors.ts` header and the `pink`
key in `tasty-augment.d.ts` all still advertised it. Confirmed absent from
the built dist, so consumer styles using it would silently stop resolving
with types still reporting it valid. Restored as the same scheme-static
literal. (`pink-01` / `pink-02` are declared in the augmentation but were
never defined on main either — pre-existing, left alone.)

CopySnippet serif — moving the code element onto the `s3` / `t3` presets
lost the font family. `s3` carries `fontFamily: var(--font-mono)` but `t3`
sets no family at all, so the `serif` variant inherited the `<code>`
element's UA monospace default and rendered monospace, contradicting the
`serif` prop's documented behaviour. Main expressed this as
`font: { '': 'monospace', serif: true }`; that map is restored alongside the
presets, which keep the size/line-height parity.

Verified: build clean, 997 tests pass, oxlint + prettier clean; `#pink` and
the serif font map both present in the built output.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8aff65c. Configure here.

Comment thread src/tokens/palette.ts
@tenphi
tenphi merged commit f9d7ebd into main Jul 30, 2026
15 checks passed
@tenphi
tenphi deleted the feat-glaze-1.2-tone-migration branch July 30, 2026 08:28
@tenphi tenphi mentioned this pull request Jul 30, 2026
tenphi added a commit that referenced this pull request Jul 30, 2026
Rebuilds the redesign branch on top of main now that the non-visual half has
landed (#1267, #1268, released as 0.150.0).

The branch's previous 22 commits were the OKHST/tone migration plus the fixes
riding on it — all of which are now IN main via #1267. Replaying them would have
meant resolving `palette.ts` against itself 15 times for a known 5-line end
state, so the branch is reconstructed on main instead of rebased commit-by-commit.
Verified the result: the tree differs from the old branch tip only where main
moved ahead (`#pink`, the CopySnippet serif font map), and both of those survive.

What remains — the actual redesign:

- `SEED_SATURATION` 80 -> 100 with `{ pastel: true }` on the default and special
  theme seeds. The two are coupled: raising the seed without pastel
  over-saturates, enabling pastel without raising it washes the palette out.

Plus two component changes that were on the branch and are unrelated to colour:

- `DialogTrigger`: `mobileType` now falls back to `'modal'` for `'popover'`
  rather than reusing `type`, so a popover gets a sheet on mobile.
- `FilterPicker`: drop `isDismissable={false}` so the picker closes on outside
  press like the other overlays.

This IS a visual change and every token moves. Per-channel RGB delta vs main,
all 156 tokens x 4 scheme variants: core surfaces/text mean ~5 (max 43), accent
mean ~28 (max 60), accent-disabled mean ~8 (max 17). Accent carries the bulk,
which is the intent — that is where the per-hue chroma inconsistency showed.

Verified: build clean, 997 tests pass, oxlint + prettier clean, size-limit
passes (451.35 kB / 460 kB).
tenphi added a commit that referenced this pull request Jul 30, 2026
Rebuilds the redesign branch on top of main now that the non-visual half has
landed (#1267, #1268, released as 0.150.0).

The branch's previous 22 commits were the OKHST/tone migration plus the fixes
riding on it — all now IN main via #1267. Replaying them would have meant
resolving `palette.ts` against itself 15 times for a 3-line end state, so the
branch is reconstructed on main rather than rebased commit-by-commit.

The whole change is now:

- `SEED_SATURATION` 80 -> 100 with `{ pastel: true }` on the default and special
  theme seeds. The two are coupled: raising the seed without pastel
  over-saturates, enabling pastel without raising it washes the palette out.

This IS a visual change and every token moves. Per-channel RGB delta vs main,
all 156 tokens x 4 scheme variants: core surfaces/text mean ~5 (max 43), accent
mean ~28 (max 60), accent-disabled mean ~8 (max 17). Accent carries the bulk,
which is the intent — that is where the per-hue chroma inconsistency showed.

Verified: build clean, 997 tests pass, oxlint + prettier clean, size-limit
passes (451.35 kB / 460 kB).
tenphi added a commit that referenced this pull request Jul 31, 2026
Rebuilds the redesign branch on top of main now that the non-visual half has
landed (#1267, #1268, released as 0.150.0).

The branch's previous 22 commits were the OKHST/tone migration plus the fixes
riding on it — all now IN main via #1267. Replaying them would have meant
resolving `palette.ts` against itself 15 times for a 3-line end state, so the
branch is reconstructed on main rather than rebased commit-by-commit.

The whole change is now:

- `SEED_SATURATION` 80 -> 100 with `{ pastel: true }` on the default and special
  theme seeds. The two are coupled: raising the seed without pastel
  over-saturates, enabling pastel without raising it washes the palette out.

This IS a visual change and every token moves. Per-channel RGB delta vs main,
all 156 tokens x 4 scheme variants: core surfaces/text mean ~5 (max 43), accent
mean ~28 (max 60), accent-disabled mean ~8 (max 17). Accent carries the bulk,
which is the intent — that is where the per-hue chroma inconsistency showed.

Verified: build clean, 997 tests pass, oxlint + prettier clean, size-limit
passes (451.35 kB / 460 kB).
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.

1 participant