Skip to content

StylePanel: custom colour on the Neutral row (3.1) - #581

Merged
lorant-one merged 1 commit into
previewfrom
feat/stylepanel-neutral-custom
Nov 23, 2026
Merged

lorant-one merged 1 commit into
previewfrom
feat/stylepanel-neutral-custom

Conversation

@lorant-one

Copy link
Copy Markdown
Member

Lorant asked for this for 3.1. StylePanel already had a custom colour on Brand and Accent; now Neutral can have one too. ThemeProvider and ThemeInit already took neutralSeed, so this is the panel side only.

What changes

  • customColors takes a list of rows as well as true: customColors={["brand", "accent", "neutral"]}. true still means Brand and Accent only, so hosts that render two seeds (Tavilio's site builder) see no new swatch.
  • StylePanelNeutral takes custom, like StylePanelBrand and StylePanelAccent. Choosing it reports { neutral: "custom", neutralSeed }, and the colour field edits the seed.
  • labels.custom.neutral (swatch, picker, description(seed)) holds the Neutral row's words. They're kept separate so the existing row parameter stays "brand" | "accent", and translations keyed on it (Tavilio's t(`customPicker.${row}`)) keep compiling.
  • StylePanelValue.neutralSeed, plus new exported types StylePanelCustomColors and StylePanelNeutralCustomLabels.
  • Internally, the Brand, Accent and Neutral rows share one row builder (colorRow), so the Neutral custom swatch behaves exactly like the other two: keyboard, scroll-into-view, kept seed, ignored clear button.

Checks

  • Six new tests in style-panel-custom-color.test.tsx: true leaves Neutral off; a list offers exactly those rows; the reported value and the field edits; the composed custom prop; translated words; axe with the picker open. Blocks: 395/395 pass, with type tests clean.
  • Biome is clean, and the docs example check reports 0 problems.
  • Docs: the StylePanel page's Custom colour section and props table. CHANGELOG [Unreleased] › Added.

Generated by Claude Code

customColors takes a list of rows as well as true, so Neutral can offer a
grey of the host's own, reported as neutralSeed; StylePanelNeutral takes
custom like Brand and Accent. true keeps meaning Brand and Accent, and the
Neutral row's words live under labels.custom.neutral, so existing hosts
and their translations compile and behave as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016gNJtwQuhoLQdpygLCVEyk
@lorant-one
lorant-one merged commit 3e44a3c into preview Nov 23, 2026
10 checks passed
@lorant-one lorant-one added the approved label Nov 23, 2026 — with Claude
@lorant-one lorant-one mentioned this pull request Nov 23, 2026
6 tasks done
@lorant-one
lorant-one deleted the feat/stylepanel-neutral-custom branch November 29, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants