Repository navigation
palette: themePalette() gives the theme editor's colors (recipe v3, 3:1 icons, tinted inks, track, toast, coloured cards, the look's colors) - #13069
josephfarina wants to merge 13 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
There was a problem hiding this comment.
On hold: approval needs an engineering owner to approve the AST-008 FR19 amendment, and the blocking findings below need fixing.
FR19 says the theme editor names astryx-oklch-v2 for a new palette and sets no icon contrast rule, while this PR moves the editor to the new astryx-oklch-v3 recipe and picks accent and status icons at 3:1, so an engineering owner (the author may, as one) records the decision by commenting /approve-spec <full head SHA>, settling whether the 3:1 icon rule also applies to palettes pinned to v1 or v2 and whether PALETTE_RECIPE_NEWEST, an alias later releases will move, should be public.
Blocking findings:
- The editor's note still says "warning text and icons use shade …" (
packages/core/src/palette/mapping.ts:1375, and its CLI copy), but icons now get their own 3:1 shade: with an exact light warning#c2690athe note names#744700while the icon is#945d00. - v3 is described inaccurately: the CLI changeset says the middle of a ramp is drawn as v1 draws it, but v3 draws shades 55–70 as v2 does (for
#4f6a7aat shade 55, v1 gives#008fc6and v3#68899d); the description omits that shades 75–85 move too; and four CLI docs promise pale tints at or below the seed's chroma without the shade-90 bound, which shades 75–85 break. - "New palettes name v3" is broader than what ships, because
packages/cli/assets/theme.template.ts:159and theauthor-a-themeguide example still useastryx-oklch-v2. PALETTE_RECIPE_V3andPALETTE_RECIPE_NEWEST(palette) are outside the pull request's declared scope (none: the title has no conventional-commit scope and the body has no## Scope/Components:line).ThemePalette.recipe,ThemePaletteInput.recipeand the CLI'sThemePaletteGenerateResponse.data.recipe(theme) are outside the declared scope.TonalPaletteCandidate.recipe(Core and CLI) is outside the declared scope.TonalPaletteGenerationInput.recipe(Core and CLI) is outside the declared scope.TonalPaletteNormalizedRequest.recipe(Core and CLI) is outside the declared scope.- The CLI's
TonalPaletteGenerationReceipt.recipeis outside the declared scope. - The experimental theme editor's new-palette recipe default is outside the declared scope.
A ## Scope section with a Components: line naming these rows clears the last six findings, and the owner decision they need is the spec decision above.
Claims and files checked
Review mode: full; reason: no-earlier-review
Claims:
- themePalette() gives accent and status icons the shade nearest the fill at 3:1: verified (mapping.ts:1386-1401; themePalette() output before and after)
- Status dots are included: verified (StatusDot reads the icon tokens)
- themePalette() and generateTonalPalette() accept v3: verified (themePalette.ts:99-100 reads the recipe list, which now has v3)
- v3 keeps shade 90 and paler at or below the seed's chroma: verified (sampled across dusty seeds, vibrancy 0 to 100, light and dark)
- The palette entry exports the two new recipe constants: verified (palette index)
- A palette that names no recipe still runs v1: verified (themePalette.ts:99)
- v1 and v2 draw the ramps they shipped with: verified (new v2 pin passes on the base and the head); icon tokens still move
- The middle of a v3 ramp is drawn as v1 draws it: false (it is v2's)
- v3 is v2 except shade 90 and paler: false (shades 75–85 move too)
- New palettes, including the editor's, name v3: true for the editor; false for the theme template and the author guide
- A palette keeps the recipe its config names: verified (editor plan; config test)
- The editor's icons and status dots read at 3:1 nearer the fill: verified (new editor test; built theme with an exact warning fill)
- FR19 gains one sentence for each rule: verified (spec diff)
- The CLI engine matches Core's source: verified (check passes)
- Changesets pass, and lint and formatting are clean on changed files: verified (0 lint errors; formatting clean)
Files:
- .changeset/core-palette-icon-graphic-contrast.md: clear
- .changeset/core-palette-recipe-v3.md: clear
- .changeset/palette-recipe-v3.md: finding (middle-of-ramp claim; new-palette claim)
- .changeset/status-dot-graphic-contrast.md: clear
- docs/specs/AST-008/spec.md: awaiting spec approval
- packages/cli/api/theme-edit/_palette.mjs: awaiting spec approval (editor default)
- packages/cli/api/theme-edit/theme-palette-recipe.test.mjs: clear
- packages/cli/api/theme-edit/theme-palette.test.mjs: clear
- packages/cli/api/theme-edit/theme-status-dot-graphic-contrast.test.mjs: clear
- packages/cli/api/theme/generateTonalPalette.doc.mjs: finding (pale-tint bound)
- packages/cli/api/theme/palette/generate/generate.test.mjs: clear
- packages/cli/api/theme/palette/generate/generator.mjs: finding (generated copy of the v1 comment)
- packages/cli/api/theme/palette/generate/mapping.mjs: finding (generated copy of the note)
- packages/cli/api/theme/palette/generate/recipe-v2.test.mjs: finding (comment says v1)
- packages/cli/api/theme/palette/generate/types.mjs: clear
- packages/cli/api/theme/theme.type.mjs: finding (pale-tint bound)
- packages/cli/api/theme/themePaletteGenerate.doc.mjs: finding (pale-tint bound)
- packages/cli/assets/docs/tree/generate-a-palette.doc.mjs: clear
- packages/cli/clients/cli/commands/theme-palette-generate.doc.mjs: finding (pale-tint bound)
- packages/core/src/palette/generator.ts: finding (comment says the middle is v1's)
- packages/core/src/palette/index.ts: awaiting spec approval (new exports)
- packages/core/src/palette/mapping.ts: finding (note misreports the icon shade)
- packages/core/src/palette/types.ts: awaiting spec approval (widened returned unions)
There was a problem hiding this comment.
On hold: approval needs an engineering owner to approve the AST-008 FR19 amendment, and the blocking findings below need fixing.
FR19 says the theme editor names astryx-oklch-v2 for a new palette and sets no icon contrast rule, while this pull request moves the editor to the new astryx-oklch-v3 recipe and picks accent and status icons at 3:1, so an engineering owner (the author may, as one) records the decision by commenting /approve-spec <full head SHA>, settling whether the 3:1 icon rule also applies to palettes pinned to v1 or v2 and whether PALETTE_RECIPE_NEWEST, an alias later releases will move, should be public.
Blocking findings:
PALETTE_RECIPE_V3andPALETTE_RECIPE_NEWEST(palette) are outside the pull request's declared scope, because the title names no conventional-commit scope and the body has no## Scopesection with aComponents:line.ThemePalette.recipe,ThemePaletteInput.recipeand the CLI'sThemePaletteGenerateResponse.data.recipe(theme) are outside the declared scope.TonalPaletteCandidate.recipe(Core and CLI) is outside the declared scope.TonalPaletteGenerationInput.recipe(Core and CLI) is outside the declared scope.TonalPaletteNormalizedRequest.recipe(Core and CLI) is outside the declared scope.- The CLI's
TonalPaletteGenerationReceipt.recipeis outside the declared scope. - The experimental theme editor's new-palette recipe default is outside the declared scope.
A ## Scope section with a Components: line naming these rows clears all seven, and the owner decision they need is the spec decision above. The earlier editor-note, v3-wording, CLI-doc and new-palette findings are fixed at this head, and two non-blocking wording suggestions are inline.
Claims and files checked
Review mode: incremental; reason: none
- changed rules (0): none
Claims:
- themePalette() gives accent and status icons the shade nearest the fill that reads at 3:1: verified (mapping.ts:1382-1401; before and after frames)
- Status dots are included: verified (StatusDot.tsx:90, :103, :116 read the icon tokens)
- A warning icon stays nearer amber where warning text deepens: verified (bright warning icon #745b00 to #927300, text unchanged)
- themePalette() and generateTonalPalette() accept v3: verified (themePalette.ts:99-100 checks the recipe list, which now holds v3; config test)
- v3 keeps shade 90 and paler at or below the seed's chroma: verified (dusty-seed sweep, vibrancy 0 to 100, light and dark)
- Up to shade 70 a v3 ramp is drawn as v2 draws it, and v3 changes shades 75 and paler: verified (ramp probe)
- v3 is v2 with the shade-90 bound (description and Core release note): verified as narrower than the change, since shades 75 to 85 also move
- The palette entry exports the two new recipe constants: verified (palette index.ts)
- A palette that names no recipe still runs v1: verified (themePalette.ts:99)
- v1 and v2 draw the ramps they shipped with, pinned by a new test: verified (v2 pin test passes); icon tokens still move
- The theme editor names v3 for a new palette: verified (_palette.mjs:764; editor test)
- A palette keeps the recipe its config names: verified (editor plan; config test)
- The editor's icons and status dots read at 3:1 nearer the fill: verified (new editor test; editor probe)
- FR19 gains one sentence for each rule: verified (spec diff)
- The CLI engine matches Core's source: verified (check passes)
- Changesets pass, and lint and formatting are clean on the changed files: verified (changeset check; 0 lint errors; formatting clean)
Files:
- .changeset/core-palette-icon-graphic-contrast.md: clear
- .changeset/core-palette-recipe-v3.md: clear (non-blocking wording suggestion)
- .changeset/palette-recipe-v3.md: clear
- .changeset/status-dot-graphic-contrast.md: clear
- docs/specs/AST-008/spec.md: awaiting spec approval
- packages/cli/api/theme-edit/_palette.mjs: awaiting spec approval (editor default); tag-along default
- packages/cli/api/theme-edit/theme-palette-recipe.test.mjs: clear
- packages/cli/api/theme-edit/theme-palette.test.mjs: clear
- packages/cli/api/theme-edit/theme-role-text-follows-exact-fill.test.mjs: clear (stale header comment, non-blocking)
- packages/cli/api/theme-edit/theme-status-dot-graphic-contrast.test.mjs: clear
- packages/cli/api/theme/generateTonalPalette.doc.mjs: clear
- packages/cli/api/theme/palette/generate/generate.test.mjs: clear
- packages/cli/api/theme/palette/generate/generator.mjs: clear (generated copy)
- packages/cli/api/theme/palette/generate/mapping.mjs: clear (generated copy of the comment suggestion)
- packages/cli/api/theme/palette/generate/recipe-v2.test.mjs: clear (stale comment, non-blocking)
- packages/cli/api/theme/palette/generate/types.mjs: finding (tag-along rows)
- packages/cli/api/theme/theme.type.mjs: finding (tag-along rows)
- packages/cli/api/theme/themePaletteGenerate.doc.mjs: clear
- packages/cli/assets/docs/tree/generate-a-palette.doc.mjs: clear
- packages/cli/clients/cli/commands/theme-palette-generate.doc.mjs: clear
- packages/core/src/palette/generator.ts: awaiting spec approval (v3 recipe and exports)
- packages/core/src/palette/index.ts: finding (tag-along rows)
- packages/core/src/palette/mapping.ts: awaiting spec approval (icon rule); non-blocking comment suggestion
- packages/core/src/palette/types.ts: finding (tag-along rows)
| // Accent text is the color given where it reads on what it sits on | ||
| // on (the surfaces and the tint), in each mode its fill is |
There was a problem hiding this comment.
Non-blocking: this rewrite now reads "on what it sits on / on (the surfaces …)", the "they" two lines down no longer has a plural subject, and the block serves every role, not only accent. Suggested:
// Text keeps the exact fill color where it reads on the surfaces and the
// tint. Where it does not, it moves to the nearest shade that reads, and the
// check says so.Then regenerate the CLI copy (mapping.mjs:1542-1545).
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [feat] `@astryxdesign/core/palette`: `themePalette()` and `generateTonalPalette()` also take the `astryx-oklch-v3` recipe (v2, with a dusty seed's palest tints, shade 90 and paler, kept at or below its own chroma), and the entry exports `PALETTE_RECIPE_V3` and `PALETTE_RECIPE_NEWEST`. A palette that names no recipe still runs `astryx-oklch-v1`, and v1 and v2 draw what they shipped with. |
There was a problem hiding this comment.
Non-blocking: the CLI note now says "Up to shade 70 a ramp is drawn as v2 draws it; v3 changes shades 75 and paler", but this Core note describes v3 only as v2 plus the shade-90 bound. Shades 75–85 move too (olive #66662e at shade 75: #bfbf61 in v2, #bebe6e in v3). Using the CLI wording here, and in the PR body, keeps the two release notes consistent.
… v2 draws what it shipped with
…e role's fill, not at text's deeper shade
…y exports the v3 recipes, and AST-008 FR19 says icons read at 3:1
… a ramp is v2's, the bound is shade 90 and paler, the theme editor names v3, and a status note says only its text moved
…the text on dark surfaces
… that the editor and themePalette() agree
…cent tint follow themePalette() again
25ff5c9 to
3050bce
Compare
…a coloured card keeps its ink, and a tinted gray's text is already off white
There was a problem hiding this comment.
On hold: approval needs an engineering owner to approve the AST-008 FR19 amendment, and the blocking findings below need fixing.
FR19 says the theme editor names astryx-oklch-v2 for a new palette and lists only the seeds' own tokens for themePalette(), while this pull request moves the editor to astryx-oklch-v3, picks icons at 3:1, and makes themePalette() write the look's colors, tinted inks, the track, the error toast fill and unlifted card text for every recipe, so existing v1 and v2 palette themes change on upgrade. An engineering owner records that decision by commenting /approve-spec <full head SHA> (the author may, as one), saying whether these rules apply to palettes pinned to v1 or v2 and whether PALETTE_RECIPE_NEWEST, an alias later releases will move, should be public.
Blocking findings:
- With a tinted gray such as slate
#64748band nodangerseed, the dark error toast's text becomes#eaf1fdat 4.14:1 on Core's#e3193b, under the 4.5:1 that#ffffffgave at 4.70:1, because--color-on-darkis drawn inside the ramp (packages/core/src/palette/mapping.ts:374-380). - The tinted-ink release notes and description say any tinted
neutralseed tints the inks and only a pure gray keeps black and white, but a seed under OKLCH chroma 0.02, such as stone#78716cor zinc#71717a, keeps#000000and#ffffff(mapping.ts:481-485). .changeset/core-palette-track.mdsays--color-trackis a progress bar's track, but ProgressBar's track is--color-background-muted; the token paints Slider's track and Spinner's ring.- The description says FR19 gains a sentence for each rule, but the accent-tint rule has none in the amendment.
ThemePalette.components(packages/core/src/palette/types.ts:190and its CLI copy),DefineThemeInput.palette(packages/core/src/theme/defineTheme.ts:426-427) and the author-a-theme guide still say the palette lifts secondary text on coloured cards, which this pull request removes.PALETTE_RECIPE_V3andPALETTE_RECIPE_NEWEST(palette) are outside the pull request's declared scope, because the title names no conventional-commit scope and the body has no## Scopesection with aComponents:line.ThemePalette.recipe,ThemePaletteInput.recipeand the CLI'sThemePaletteGenerateResponse.data.recipe(theme) are outside the declared scope.TonalPaletteCandidate.recipe(Core and CLI) is outside the declared scope.TonalPaletteGenerationInput.recipe(Core and CLI) is outside the declared scope.TonalPaletteNormalizedRequest.recipe(Core and CLI) is outside the declared scope.- The CLI's
TonalPaletteGenerationReceipt.recipeis outside the declared scope. - The experimental theme editor's new-palette recipe default is outside the declared scope.
A ## Scope section with a Components: line naming these rows clears the last seven findings; the earlier editor-note, v3-wording, CLI-doc and new-palette findings stay fixed.
Claims and files checked
Review mode: full; reason: rebase
Claims (description):
- themePalette() and defineTheme({palette}) give the editor's colors for the same seeds and recipe: not proven (one shared mapping source and a byte-checked CLI copy, but no test compares an editor-built theme with themePalette() output)
- v3 is v2 with a dusty seed's palest tints (shade 90 and paler) at or below its chroma, and up to shade 70 a ramp is v2's: verified (the v3 recipe test; ramp probe)
- A palette that names no recipe runs v1, and v1 and v2 draw what they shipped with: verified (themePalette.ts:100; ramp digest test)
- The entry exports the two v3 constants and the editor names v3 for a new palette: verified (palette index.ts:17-19; _palette.mjs:1248)
- Accent and status icons take the 3:1 shade nearest the fill: verified (every role icon reads 3:1 or more and moves toward its fill)
- A tinted neutral seed's primary text, icons and on-dark text carry its tint, and a pure gray keeps black and white: false as stated (a stone or zinc gray keeps black and white below chroma 0.02)
- The neutral seed reaches the slider track at the shade nearest Core's: verified (slate track #c8d6e9 against Core's #ccd3db)
- The danger seed reaches the error toast fill at the shade nearest Core's: verified (#9c0045 against Core's #aa071e)
- The accent tint moves under exact accent text and themePalette() output does not change: verified (accent tint unchanged in every probe; editor test)
- A coloured card keeps its own secondary text: verified (no card part styles; that text reads 4.6:1 or more on every card fill)
- The look's category, chart, code, scrim and unset status colors come from the seeds and read on Core's surfaces: verified for role and category text and icons on the surfaces
- FR19 gains a sentence for each rule: false (the accent-tint rule has none)
- A themePalette()-only import grows from about 18 KB to about 25 KB gzip: verified (18.2 KB to 25.3 KB)
- One Core and one CLI patch changeset per rule: verified (8 and 8)
Claims (changesets):
- Core card ink, families, icons, recipe v3, tint and toast notes: verified (probe, tests)
- Core ink note: false as stated (stone and zinc grays keep black and white)
- Core track note: false (a progress bar's track is not this token; a spinner's ring is)
- CLI card ink, families, tint, toast, track, recipe v3 and status-dot notes: verified (12 changed CLI test files pass), families parity not proven by a test
- CLI ink note: false as stated (same threshold)
Files:
- .changeset/core-palette-card-ink.md: clear
- .changeset/core-palette-families.md: clear
- .changeset/core-palette-icon-graphic-contrast.md: clear
- .changeset/core-palette-ink.md: finding (tinted-gray claim)
- .changeset/core-palette-recipe-v3.md: clear (non-blocking wording)
- .changeset/core-palette-tint.md: clear
- .changeset/core-palette-toast.md: clear
- .changeset/core-palette-track.md: finding (names the progress bar's track)
- .changeset/experimental-theme-palette-card-ink.md: clear
- .changeset/experimental-theme-palette-families.md: clear (parity not proven by a test)
- .changeset/experimental-theme-palette-ink.md: finding (tinted-gray claim)
- .changeset/experimental-theme-palette-tint.md: clear
- .changeset/experimental-theme-palette-toast.md: clear
- .changeset/experimental-theme-palette-track.md: clear
- .changeset/palette-recipe-v3.md: clear
- .changeset/status-dot-graphic-contrast.md: clear
- docs/specs/AST-008/spec.md: awaiting spec approval (no accent-tint sentence)
- packages/cli/api/theme-edit/_palette.mjs: awaiting spec approval (editor default); tag-along default
- packages/cli/api/theme-edit/theme-change-leaves-unchecked-unreached.test.mjs: clear
- packages/cli/api/theme-edit/theme-colors-reach-core-defaults.test.mjs: clear
- packages/cli/api/theme-edit/theme-how-answer-wording.test.mjs: clear
- packages/cli/api/theme-edit/theme-missed-step-lines.test.mjs: clear
- packages/cli/api/theme-edit/theme-palette-recipe.test.mjs: clear
- packages/cli/api/theme-edit/theme-palette.test.mjs: clear
- packages/cli/api/theme-edit/theme-role-text-follows-exact-fill.test.mjs: clear
- packages/cli/api/theme-edit/theme-status-dot-graphic-contrast.test.mjs: clear
- packages/cli/api/theme-edit/theme-text-on-accent-tint.test.mjs: clear
- packages/cli/api/theme-edit/theme-tinted-gray-ink.test.mjs: clear (does not check the toast pair)
- packages/cli/api/theme/generateTonalPalette.doc.mjs: clear
- packages/cli/api/theme/palette/generate/editor-look.mjs: clear (generated copy)
- packages/cli/api/theme/palette/generate/generate.test.mjs: clear
- packages/cli/api/theme/palette/generate/generator.mjs: clear (generated copy)
- packages/cli/api/theme/palette/generate/mapping.mjs: finding (generated copy of the on-dark tint)
- packages/cli/api/theme/palette/generate/recipe-v2.test.mjs: clear (the removed v2 pin is covered by the digest test)
- packages/cli/api/theme/palette/generate/types.mjs: finding (coloured-card doc; tag-along rows)
- packages/cli/api/theme/theme.type.mjs: finding (tag-along rows)
- packages/cli/api/theme/themePaletteGenerate.doc.mjs: clear
- packages/cli/assets/docs/tree/generate-a-palette.doc.mjs: clear
- packages/cli/clients/cli/commands/theme-palette-generate.doc.mjs: clear
- packages/core/src/palette/editor-look.ts: clear
- packages/core/src/palette/generator.ts: awaiting spec approval (recipe v3)
- packages/core/src/palette/index.ts: finding (tag-along rows)
- packages/core/src/palette/mapping.ts: finding (on-dark tint under 4.5:1 on the dark error toast); awaiting spec approval
- packages/core/src/palette/themePalette.test.ts: clear
- packages/core/src/palette/themePalette.ts: awaiting spec approval (the look's colors)
- packages/core/src/palette/types.ts: finding (coloured-card doc; tag-along rows)
| '--color-icon-primary', | ||
| // Text on a dark surface (a toast, a card over the scrim): tinted with | ||
| // the surface it sits on. | ||
| '--color-on-dark', |
There was a problem hiding this comment.
--color-on-dark is the text of the error toast too. With a slate gray (#64748b) and no danger seed, the palette leaves the toast fill at Core's dark #e3193b, and this tint gives the text #eaf1fd at 4.14:1 there (white gave 4.70:1; Toast keeps the dark side because --color-on-light reads only 4.03:1). Suggest tinting --color-on-dark only to a shade that reads at 4.5:1 on every inverted fill it sits on, the palette's or Core's (--color-background-inverted, --color-background-error-inverted), and keeping the ramp's end otherwise. The comment at line 1190 ("which always reads") then holds.
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [feat] `@astryxdesign/core/palette`: `themePalette()` draws a tinted `neutral` seed's primary text, primary icons and `--color-on-dark` inside its ramp, so they carry the gray's tint instead of pure black and white. A pure gray keeps black and white. |
There was a problem hiding this comment.
The rule runs only when !isGray(seed), OKLCH chroma 0.02 or more (mapping.ts:481-485), so a stone #78716c (0.012) or zinc #71717a (0.014) keeps pure black and white. Suggest: "draws the primary text, primary icons and --color-on-dark of a neutral seed with OKLCH chroma of 0.02 or more (a slate, not a stone or zinc gray) inside its ramp". The same applies to the CLI note and the FR19 sentence.
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [feat] `@astryxdesign/core/palette`: `themePalette()` with a `neutral` seed sets `--color-track` (a slider's and a progress bar's track) at the gray's shade nearest Core's own track color, so a warm or cool gray reaches it as it reaches the surfaces. |
There was a problem hiding this comment.
ProgressBar's track is --color-background-muted (ProgressBar.tsx:265-268); --color-track paints Slider's track (Slider.tsx:333, :531) and Spinner's ring (Spinner.tsx:337, :341). Suggest "(a slider's track and a spinner's ring)".
| readonly recipe: 'astryx-oklch-v1' | 'astryx-oklch-v2' | 'astryx-oklch-v3'; | ||
| /** Each color token's `[light, dark]` value. */ | ||
| readonly tokens: Readonly<Record<string, readonly [string, string]>>; | ||
| /** Part styles that lift secondary text on the accent tint, the neutral track and the coloured cards, as the official themes do, by part and style key. */ |
There was a problem hiding this comment.
components no longer holds coloured cards (LIFT_PARTS drops card variant:*), so this doc, its CLI copy (types.mjs:120), DefineThemeInput.palette (theme/defineTheme.ts:426-427) and the author-a-theme guide (author-a-theme.doc.mjs:46) promise part styles a caller no longer gets. Suggest dropping "and the coloured cards" in all four.
HOLD: draft until the AST-008 owners approve the amendment.
What this changes
themePalette()anddefineTheme({palette})give the same colors as the theme editor for the same seeds and recipe (AST-008 DEC-16). Round 15 kept these rules out of Core's shared mapping sothemePalette()stayed as it was. This PR brings them intothemePalette(), one commit each:astryx-oklch-v3. It is v2, except that a dusty seed's palest tints (shade 90 and paler) stay at or below the seed's own chroma. Up to shade 70 a ramp is drawn as v2 draws it. A palette that names no recipe still runs v1, and v1 and v2 draw what they shipped with. The entry exportsPALETTE_RECIPE_V3andPALETTE_RECIPE_NEWEST; the theme editor names v3 for a new palette.neutralseed's primary text, primary icons and text on dark surfaces (--color-on-dark) carry its tint. A pure gray keeps black and white.neutralseed reaches--color-track, at the shade nearest Core's own.dangerseed reaches--color-background-error-inverted, at the shade nearest Core's own.--color-text-accentreads.themePalette()sets no exact text, so its output does not change with this one.variant:<color>) keeps its own secondary text; the palette no longer lifts it.themePalette()also returns the colors a look grows from its seeds: category colors (Badge, Token and Card tints), chart colors, code colors and the scrim, and the status roles the input leaves unset, each kept readable on Core's surfaces.What changes, in numbers
Official themes: no change. None of the 7 official themes (neutral, stone, butter, chocolate, gothic, matcha, y2k) uses
palette. Their built CSS (generateThemeCSS) is byte-identical before and after this PR.A theme made in code with
themePalette(). Measured for each official theme's own colors used as seeds: accent, success, warning, danger and info from its light tokens, and neutral from its light secondary text; recipeastryx-oklch-v2. Contrast is against the palette's own page (--color-background-body).--color-data-*), 14 code colors, the slider track and the error toast fill.components.cardlift blocks go from 9 to 0, because coloured cards keep their own secondary text.--color-on-darkfollows primary text for a tinted seed (butter, chocolate, matcha, y2k). On the dark page it reads at 15.07–15.25:1, down from 17.1–17.4:1.Decision for the palette spec owners
Question: given an exact page color for each mode, which ramp stops should the surface, card, popover and muted colors take, relative to the page color's own position on its ramp, and in which direction? For example: in dark mode lighter than the page, and in light mode the page at stop 95 with surface and card at 100.
Today: Core derives the page and the surfaces from one neutral seed at fixed stops:
A page color set exactly does not move those stops. For example,
#5b21b6sits at about stop 35 of its ramp. In dark mode the surface stays at stop 15 (#262626), darker than the page, at 1.68:1, and the card at stop 10 is 1.92:1. So surfaces read as holes in the page rather than raised above it.Once the stops are decided, the theme editor writes the derived surface, card, popover and muted tokens from the set page color using the same ramp math as
themePalette(), as compiled tokens, with no new Core palette entry point. Core's own palette changes only if the owners decide it should for every theme.Spec
AST-008 FR19 gains sentences for each rule, and says that a theme made in the editor and one made with
themePalette()from the same seeds and recipe get the same colors.Size
A
themePalette()-only import grows from about 18 KB to about 25 KB gzip: it now carries the look's derivations, which are its output, not an optional feature.Not included
A dial's own dark value (the editor's raw
--color-accentset with--mode dark) stays out:themePalette()takes no per-seed dark value, and adding one is an API change of its own.Changesets
One
@astryxdesign/corepatch changeset and one@astryxdesign/clipatch changeset per rule.