Repository navigation
StylePanel: custom colour on the Neutral row (3.1) - #581
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
customColorstakes a list of rows as well astrue:customColors={["brand", "accent", "neutral"]}.truestill means Brand and Accent only, so hosts that render two seeds (Tavilio's site builder) see no new swatch.StylePanelNeutraltakescustom, likeStylePanelBrandandStylePanelAccent. 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 existingrowparameter stays"brand" | "accent", and translations keyed on it (Tavilio'st(`customPicker.${row}`)) keep compiling.StylePanelValue.neutralSeed, plus new exported typesStylePanelCustomColorsandStylePanelNeutralCustomLabels.colorRow), so the Neutral custom swatch behaves exactly like the other two: keyboard, scroll-into-view, kept seed, ignored clear button.Checks
style-panel-custom-color.test.tsx:trueleaves Neutral off; a list offers exactly those rows; the reported value and the field edits; the composedcustomprop; translated words; axe with the picker open. Blocks: 395/395 pass, with type tests clean.[Unreleased]› Added.Generated by Claude Code