Add custom css variables to Brand Guide#4944
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4afd58186d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Adds a new “Custom CSS Variables” section to the Brand Guide card to present (and copy) a consolidated set of brand-specific CSS variables, combining palette-derived variables and user-defined custom variables.
Changes:
- Introduces
CustomCssVariablefield type and includes its entries in Brand Guide computedcssVariables. - Adds a new Brand Guide dashboard section (
custom-css) that renders palette variable rows + custom variable rows and provides a copy-to-clipboard button. - Adds integration tests for section visibility, name normalization, filtering behavior, and computed CSS output.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/host/tests/integration/components/brand-guide-custom-css-test.gts | Adds integration coverage for the new Brand Guide “custom-css” section behavior. |
| packages/base/structured-theme.gts | Renames the “Import Custom CSS” section title to “Import CSS”. |
| packages/base/brand-guide.gts | Implements the new Brand Guide section/UI, adds CustomCssVariable, and merges custom vars into computed CSS variables. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| {{#each @model.customCssVariables as |cssVar|}} | ||
| {{#if cssVar.name}} | ||
| <dt class='var-row' data-test-brand-guide-css-var> | ||
| <code | ||
| data-test-brand-guide-css-var-name | ||
| >{{buildCssVariableName cssVar.name}}</code> | ||
| </dt> | ||
| <dd class='var-row'> | ||
| <code | ||
| class='css-var-value' | ||
| data-test-brand-guide-css-var-value | ||
| >{{cssVar.value}}</code> | ||
| </dd> | ||
| {{/if}} |
| .filter((color) => color.name) | ||
| .map((color) => ({ | ||
| color, | ||
| varName: buildCssVariableName(color.name!), | ||
| colorValue: paletteRules.get(color.name!) ?? '', |
| for (let cssVar of this.args.model?.customCssVariables ?? []) { | ||
| let name = cssVar.name?.trim(); | ||
| let value = cssVar.value?.trim(); | ||
| if (name && value) { | ||
| lines.push(`${buildCssVariableName(name)}: ${value};`); | ||
| } |
| { | ||
| id: 'import-css', | ||
| navTitle: 'Import CSS', | ||
| title: 'Import Custom CSS', | ||
| title: 'Import CSS', | ||
| fieldName: null, |
Add "custom css variables" section to Brand Guide card after the custom brand colors section. Custom variables section will display the combination of all custom vars specific to this brand guide.
Edit:

View:
