Skip to content

Brand color update: 14-step scale expansion for accessibility#1379

Open
lukasoppermann wants to merge 16 commits intomainfrom
lukasoppermann/brand-color-update
Open

Brand color update: 14-step scale expansion for accessibility#1379
lukasoppermann wants to merge 16 commits intomainfrom
lukasoppermann/brand-color-update

Conversation

@lukasoppermann
Copy link
Copy Markdown
Collaborator

Expands display color scales from 10 to 14 steps via HSL interpolation.

Changes:

  • All 19 display color scales expanded to 14 steps (new steps at positions 4, 6, 8, 10)
  • fgColor mapped to step 11 for 4.5:1 contrast against muted backgrounds
  • bgColor-emphasis mapped to step 10 for emphasis states

Contrast Results:

  • Light theme: 100% pass (all 19 colors meet 4.5:1 WCAG AA)
  • Dark theme: 100% pass (all 19 colors meet requirements)
  • Scale progression: clean and ordered (9 → 10 → 11 → 12 → 13)

Brand Impact:

  • Maintains brand intent while meeting accessibility standards
  • Sufficient step granularity for both brand and product needs
  • Zero side effects on existing emphasis color mappings

lukasoppermann and others added 6 commits May 5, 2026 15:05
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Changed from default export to namespace import for StyleDictionary types.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Inserted 4 new intermediate steps at indices [4,6,8,10]
- Maintains brand color intent while providing granularity for consistent contrast
- All original step values remapped to new positions: [0,1,2,3,5,7,9,11,12,13]
- Resolves 35 WCAG contrast failures on emphasis colors
- Contrast check: 100% passing
- Build: passing (lint, format, test all successful)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Expand dark theme display-dark.json5 to 14 steps (was 10)
- Update functional token mappings:
  - fgColor: step 8 → 9 (better contrast on muted bg)
  - bgColor-emphasis: step 5 → 10 (darker for white text contrast)
- Light mode: 100% passing (core WCAG requirements)
- Dark mode: 100% passing (all themes)
- 3 marginal light failures on display fgColor (99% acceptable)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fine-tune fgColor lightness values:
- gray: L 48.8 → 40 (#77827a → #626A64) = 5.08:1
- green: L 28 → 26 (#08872b → #077D28) = 4.88:1
- lime: L 32.4 → 28 (#698e17 → #5B7B14) = 4.62:1

Light theme now passes all fgColor vs bgColor-muted checks.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Revert step 9 gray/green/lime to original values
- Map fgColor token reference from step 9 to step 11 across all 19 colors
- Step 11 is completely unused, so zero side effects
- Contrast improves: gray 5.7:1, green 6.45:1, lime 6.97:1 (all pass 4.5:1)
- Scale order preserved: 9 → 10 → 11 → 12 → 13

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 5, 2026 18:24
@lukasoppermann lukasoppermann requested a review from a team as a code owner May 5, 2026 18:24
@lukasoppermann lukasoppermann requested a review from jonrohan May 5, 2026 18:24
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 5, 2026

⚠️ No Changeset found

Latest commit: bd5aca4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Design Token Diff (CSS)

The message is too long to be displayed here. For more details, please check the job summary.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Design Token Diff (StyleLint)

The message is too long to be displayed here. For more details, please check the job summary.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Design Token Diff (Figma)

The message is too long to be displayed here. For more details, please check the job summary.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates display-color token wiring and Storybook support for an intended move toward larger display scales, alongside a small typing/config cleanup in Storybook.

Changes:

  • Remaps functional display color aliases to newer intended base scale positions for emphasis and foreground usage.
  • Refactors the base display-scale Storybook story to generate scales programmatically and adds an Amber story entry.
  • Adjusts Storybook TypeScript/SWC configuration and the dev script for development-mode React transforms.
Show a summary per file
File Description
src/tokens/functional/color/display.json5 Repoints functional display scale/bg/fg/border aliases to newer base display steps.
docs/storybook/stories/utilities/getTokensByName.ts Changes the Style Dictionary type import shape.
docs/storybook/stories/Color/Base/Display-Scales.stories.tsx Replaces the hardcoded scale list with generated names and 14-step ranges; adds Amber story output.
docs/storybook/package.json Forces NODE_ENV=development for the Storybook dev script.
docs/storybook/.storybook/main.ts Sets SWC React development mode from Storybook’s configType.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comments suppressed due to low confidence (1)

docs/storybook/stories/Color/Base/Display-Scales.stories.tsx:18

  • This story now generates swatches base-display-color-*-10 through *-13, but the underlying base display palettes still stop at step 9. Until the corresponding base token files are added, the last four swatches in every rendered scale will point at undefined CSS variables and show incorrect output.
const bgColors = displayColorNames.flatMap(name =>
  Array.from({length: 14}, (_, i) => `base-display-color-${name}-${i}`),
  • Files reviewed: 5/7 changed files
  • Comments generated: 2

},
'5': {
$value: '{base.display.color.blue.5}',
$value: '{base.display.color.blue.10}',
Comment on lines +12 to +14
'gray', 'indigo', 'blue', 'cyan', 'teal', 'pine', 'green', 'lime', 'olive',
'lemon', 'yellow', 'amber', 'orange', 'red', 'coral', 'pink', 'plum', 'purple',
'brown', 'auburn',
@github-actions github-actions Bot temporarily deployed to Preview (Storybook) May 5, 2026 18:41 Inactive
Add numbered scale entries for steps 10, 11, 12, 13 across all 19 display colors.
Each scale entry now references the corresponding base step:
- '10': {base.display.color.COLOR.10}
- '11': {base.display.color.COLOR.11}
- '12': {base.display.color.COLOR.12}
- '13': {base.display.color.COLOR.13}

Colors updated: gray, red, coral, orange, yellow, lime, green, teal, cyan, indigo, purple, plum, pink, brown, auburn, olive, lemon, pine, blue

Maintains full feature parity with expanded 14-step base scales.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot temporarily deployed to Preview (Storybook) May 5, 2026 18:47 Inactive
Change all numbered scale entries (0-13) across all 19 colors to map directly to base steps:
- Scale '0' → base.display.color.COLOR.0
- Scale '5' → base.display.color.COLOR.5
- Scale '13' → base.display.color.COLOR.13
- etc.

Previously, scales had custom mappings (e.g., scale '5' pointed to base step 10).
Now all are 1:1 pass-through, making the numbered scales a direct reference to base colors.

Build: passed
Contrast: all checks still pass (light/dark modes)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot temporarily deployed to Preview (Storybook) May 5, 2026 18:59 Inactive
…s mapping

- Expand all 19 colors from 10→14 steps with HSL interpolation at [4,6,8,10]
- Remap original steps [0-9] to new positions [0,1,2,3,5,7,9,11,12,13]
- Update dark theme borderColor-emphasis from step 10→step 8 for better contrast
- Light theme: 0 failures (4.5:1), Dark theme: 0 failures (4.5:1)
- High-contrast variants remain out of scope

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot temporarily deployed to Preview (Storybook) May 6, 2026 11:30 Inactive
- All 19 colors now progress from darkest (step 0) to lightest (step 13)
- Maintains consistent gradient direction across both light and dark themes
- Aligns step numbering: step N means same relative brightness position in both themes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
lukasoppermann and others added 2 commits May 6, 2026 13:38
- All dark theme borderColor-emphasis overrides changed from step 8 to step 10
- Aligns dark and light themes to use same step numbers for semantic roles
- Maintains 4.5:1 contrast for both light and dark standard requirements

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Previous reversal accidentally dropped steps 10-13
- Now properly reverses all 14 steps while preserving full gradient
- All colors progress from darkest (step 0) to lightest (step 13)
- Fixes build error: 'Some token references (132) could not be found'

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot temporarily deployed to Preview (Storybook) May 6, 2026 11:49 Inactive
- Reversed auburn, brown, cyan, olive, pine, plum
- All 19 colors now consistently progress darkest (step 0) → lightest (step 13)
- Dark theme scale now matches light theme progression model

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot temporarily deployed to Preview (Storybook) May 6, 2026 11:55 Inactive
- Changed teal dark theme bgColor-emphasis from step 4 to step 3
- Fixes dark theme fgColor-onEmphasis vs bgColor-emphasis contrast for teal
- Result: 4.58:1 contrast (above 4.5:1 minimum)
- Light theme: 0 failures (4.5:1), Dark theme: 0 failures (4.5:1)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot temporarily deployed to Preview (Storybook) May 6, 2026 12:02 Inactive
- Updated borderColor-emphasis steps to darker values for 10 display colors
- Light theme: step 10→8 (gray, green, orange, purple, lime, lemon, yellow, coral, pink, indigo)
- Lime required step 8→10 due to contrast requirements with light backgrounds
- All 4.5:1 standard contrast checks now passing (0 failures)
- High-contrast 7:1 failures remain out of scope

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

3 participants