Skip to content

feat(gamut-brand)!: one tokens.css per brand, and white-label tooling - #66

Open
dreamwasp wants to merge 72 commits into
cass-gmt-1825-color-brandsfrom
cass-gmt-1825-color-white-label
Open

dreamwasp wants to merge 72 commits into
cass-gmt-1825-color-brandsfrom
cass-gmt-1825-color-white-label

Conversation

@dreamwasp

@dreamwasp dreamwasp commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Stack 4. Base: #58 (color-legacy-brands). Next: #54 and #59, #69 (both also sit on this).
Moves the color system into packages/gamut-brand: per-brand generated/<brand>/ output, the gamut-brand build --check drift check, and the white-label tooling. This is the one reviewers should read for the layout; everything above it keeps the same layout.
Known failing test (pre-existing, not from this stack): Alert/__tests__/Alert.test.tsx uses jest.requireActual and @emotion/jest, which do not exist under Vitest.


Overview

Two connected changes. Every brand now ships its own tokens.css, instead of all brands sharing one file. And the color generator moves into a new package, @skillsoft/gamut-brand, so a team can build its own brand (white-labeling) at build time and keep gamut's types.

A team's brand can't be baked into a file gamut ships, so per-brand output and a public generator are one piece of work.

Per-brand CSS

  • tokens.css holds one brand: its palette on :root, [data-brand], its initial mode's roles on :root, then the other mode. A page starts in the right brand and mode with nothing set on <html>.
  • A brand's role overrides sit in its mode blocks, so a bare data-color-mode keeps them.
  • Generated output moves to src/tokens/generated/<brand>/, and a page carries only its own brand. The split was checked against the old shared file: all five brands, both modes, identical values.
  • initialMode moves onto the brand, because its CSS has to know it at build time. Platform starts dark in its CSS too, so a server-rendered page starts dark.
  • The DTCG mode files now include each brand's role overrides. Before, every brand got the default roles.

@skillsoft/gamut-brand

  • New package, build time only (a dev dependency). It holds the generator, the roles, the checks and gamut's five brands, moved from gamut-styles/src/colorSystem.
  • defineBrand({ name, hues }) types a brand. gamut-brand build <file> writes values.ts, tokens.css and DTCG JSON. --watch regenerates on change and only rewrites files whose contents changed. --check writes nothing and fails CI when the files are stale.
  • A brand that fails a check isn't written. Every check runs again on the brand's own tokens.css read back, so what ships is what was checked.
  • createBrandTheme, BrandBase and BrandValues are exported from gamut-styles. A team's theme has the same type as gamut's own, so system props, css(), variant() and states() stay typed.
  • gamut-styles' build:tokens is now a loop over gamut's five brands using the same API.

Tests

  • generator.test.ts holds the generator to its rules, at every 5° of hue:
    • fixed lightness per grade, and chroma inside sRGB
    • the separation guarantee
    • one role mapping for every brand, apart from its overrides
    • every check passing, for our brands and for a primary-only brand
  • These replace the sandbox parity test. Parity only mattered while porting, so nothing in the package points at the sandbox anymore.
  • cli.test.ts runs the CLI end to end: build, check, unchanged files, a refused brand, a bad name.
  • gamut-styles has a test that the generated files are current, and that each brand ships only itself.

Breaking

  • Generated file paths: @skillsoft/gamut-styles/tokens/<brand>.css for a brand's CSS (tokens.css stays the default brand), and tokens/<brand>/{palette,light,dark}.tokens.json.
  • initialMode moves from createBrandTheme to the brand. BrandBase now requires gamut's font family and font weight keys.

Merge order: after #58, before #54. #54, #63, #59 and #73 already have this merged in.


PR Checklist

  • Related to designs:
  • Related to JIRA ticket: GMT-1825
  • Version plan added/updated (.changeset/color-system-white-label.md)
  • I have run this code to verify it works
  • This PR includes unit tests for the code change
  • This PR includes testing instructions for the code change

Testing Instructions

  1. npx nx run-many -t test,lint,build,verify-package -p gamut-brand gamut-styles: all pass.
  2. yarn workspace @skillsoft/gamut-styles build:tokens --check: "generated tokens are current".
  3. Open packages/gamut-styles/src/tokens/generated/originalCodecademy/tokens.css. It has one brand's palette, its light roles on :root, and the dark mode's yellow action-primary.
  4. Try a team brand: write defineBrand({ name: 'acme', hues: { primary: '#0A5CFF' } }) to a file and run gamut-brand build on it. Then change the hue with --watch running and see only the changed files rewritten.

🤖 Generated with Claude Code

Build: yarn build fails on this PR: gamut:build type-checks components that still use the old color names, and #54 moves them to color roles. The build passes on #54 (cass-gmt-1825-color-components, af734ec).

dreamwasp and others added 13 commits October 29, 2026 10:38
…s brands

Each old theme becomes a brand of the generated color system, so every
theme defines every role and components on roles work under all of them.

- Hues come from what the old theme rendered in each job, including what
  it inherited from core. Page backgrounds, text and yellow are pinned.
  Percipio and lxStudio keep core's yellow accent and dark mode.
- Fonts, weights, elevation and lxStudio's radii are unchanged.
  createBrandTheme takes `borderRadii` and `initialMode`; platform starts
  in dark mode and adds its editor-* colors with their old values.
- The two-color gradient pairs primary with accent-alt for every brand
  with a yellow accent, as design asked for Original Codecademy.
- validate-tokens treats a polished rounding tie as agreement with the
  content-mode table and reports it (percipio primary-600).
- The styling contract test only reads the blocks of the brand it tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gacy-brands

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Design feedback on the comparison page (2026-10-29): pinned navy-800
carries much more chroma than the generated surfaces beside it. As for
Original Codecademy (#52), lxStudio uses the generated step at navy's hue.
Admin and platform inherit Original Codecademy's pins, so they follow;
platform's blue-0 and the near-white pages are nearly achromatic and stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- percipioTheme, the PercipioTheme type and the percipio brand are removed,
  with its Storybook theme option and Foundations page. The Percipio fonts
  and elevation stay, since skillsoftTheme and lxStudioTheme use them.
- lxStudio's yellow is generated rather than pinned; only its near-white
  page stays pinned, and its dark primary stays sapphire.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-legacy-brands

- admin, platform and lxStudio take the soft elevation drawn in the shadow
  roles; only Original Codecademy keeps the hard offset (design's sandbox,
  df33b47: the hard offset is the Codecademy theme's only).
- Original Codecademy's overrides split into coreFamilyOverrides (the pins,
  the yellow dark primary, the gradient), which admin and platform share,
  and its own transparent shadow-ambient, which they don't.
- Tokens regenerated; theme snapshots updated for the shadow roles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…heme

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each brand theme now carries and injects only its own brand's CSS (about
21 KB, down from 56 KB for every brand at once). The CSS puts the brand's
palette and initial mode on :root, and folds its role overrides into its
mode blocks. Every brand resolves to the same values as before in both modes.

The generator, role table, checks, sandbox fixture and gamut's brand inputs
move from gamut-styles' src/colorSystem to a new build-time package,
@skillsoft/gamut-brand. Its `gamut-brand build` CLI writes a brand's
values.ts, tokens.css and DTCG JSON (--watch, --check), and refuses a brand
that fails a check, including on its own tokens.css read back.
gamut-styles' build:tokens uses the same writeBrand on gamut's five brands.

- createBrandTheme, BrandBase and BrandValues are exported. A team's theme
  has the same type as gamut's, so system props stay typed.
- BREAKING: generated files move to one folder per brand
  (tokens/<brand>.css, tokens/<brand>/*.tokens.json; tokens.css stays the
  default brand). initialMode moves from the theme onto the brand.
- DTCG mode files include each brand's role overrides.
- Role names in brand overrides are typed (ROLE_TOKENS).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sandbox parity only matters while the port is in development. The
generator is now held to its own rules for any hue (fixed lightness per
grade, chroma inside sRGB, the separation guarantee, one role mapping
for every brand, every check passing) instead of a saved copy of the
sandbox's output. The checked-in generated files still catch value drift.

Drops the sandbox fixture, dump script and comments that pointed at
sandbox commits and files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dreamwasp and others added 2 commits November 10, 2026 09:10
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
dreamwasp and others added 12 commits November 10, 2026 11:26
… cass-gmt-1825-color-legacy-brands

# Conflicts:
#	.changeset/color-system-brands.md
#	packages/.storybook/components/Elements/DocsContainer.tsx
#	packages/.storybook/preview.ts
#	packages/.storybook/theming/GamutThemeProvider.tsx
#	packages/gamut-styles/src/__tests__/AssetProvider.test.tsx
#	packages/gamut-styles/src/__tests__/fontLoading.test.tsx
#	packages/gamut-styles/src/__tests__/stylingContract.test.tsx
#	packages/gamut-styles/src/colorSystem/README.md
#	packages/gamut-styles/src/themes/__tests__/__snapshots__/theme.test.ts.snap
#	packages/gamut-styles/src/themes/__tests__/theme.test.ts
#	packages/gamut-styles/src/themes/admin.ts
#	packages/gamut-styles/src/themes/index.ts
#	packages/gamut-styles/src/themes/lxStudio.ts
#	packages/gamut-styles/src/themes/platform.ts
#	packages/gamut-styles/src/tokens/generated/tokens.css
#	packages/gamut-styles/src/tokens/generated/tokensCss.ts
#	packages/gamut/src/Alert/__tests__/Alert.test.tsx
…s' into cass-gmt-1825-color-white-label

# Conflicts:
#	.changeset/color-system-brands.md
#	packages/gamut-brand/src/__tests__/system.test.ts
#	packages/gamut-styles/scripts/build-tokens.ts
#	packages/gamut-styles/scripts/validate-tokens.ts
#	packages/gamut-styles/src/colorSystem/README.md
#	packages/gamut-styles/src/themes/__tests__/__snapshots__/theme.test.ts.snap
#	packages/gamut-styles/src/themes/__tests__/brandElevation.test.ts
#	packages/gamut-styles/src/themes/__tests__/theme.test.ts
#	packages/gamut-styles/src/themes/platform.ts
#	packages/gamut-styles/src/tokens/generated/tokens.css
#	packages/gamut-styles/src/tokens/generated/tokensCss.ts
Vite failed with 'The symbol skillsoftTheme has already been declared'
in GamutThemeProvider and DocsContainer. Introduced by the brands merge.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Roboto 500 and 700 share one bold file, so the preload list had two links
with the same key (the file URL), and React warned about duplicate keys.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Roboto 500 and 700 share one bold file, so the preload list had two links
with the same key (the file URL), and React warned about duplicate keys.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
The skill triaged scope-swap only. Add a color-roles section: the dry-run and
real-run steps, what the warnings and color-roles: comments mean and what to
do for each, the checks before calling it done, and what not to do. The
description names the preset so the skill triggers on color-name work.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
(cherry picked from commit 6f0e3de)
The skill triaged scope-swap only. Add a color-roles section: the dry-run and
real-run steps, what the warnings and color-roles: comments mean and what to
do for each, the checks before calling it done, and what not to do. The
description names the preset so the skill triggers on color-name work.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
(cherry picked from commit 6f0e3de)
…on and cover every preset

The skill covered scope-swap only. It's now gamut-migration: a presets table,
one workflow for all presets, a section per preset (scope-swap, color-roles),
and a section on documenting a new preset. Renames the changeset to match.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
(cherry picked from commit f5bf30b)
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
(cherry picked from commit 15c7699)
…section

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
(cherry picked from commit 80522ce)
…on and cover every preset

The skill covered scope-swap only. It's now gamut-migration: a presets table,
one workflow for all presets, a section per preset (scope-swap, color-roles),
and a section on documenting a new preset. Renames the changeset to match.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
(cherry picked from commit f5bf30b)
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
(cherry picked from commit 15c7699)
@dreamwasp
dreamwasp marked this pull request as ready for review November 30, 2026 13:35
@dreamwasp
dreamwasp requested a review from a team as a code owner November 30, 2026 13:35
dreamwasp and others added 3 commits December 1, 2026 15:38
…olor-white-label

# Conflicts:
#	packages/gamut-brand/src/migration.ts
Resolved in favor of legacy-brands: Percipio is gone from the theme list, and the elevation example names Skillsoft.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
dreamwasp and others added 2 commits December 2, 2026 14:48
Takes brands' generator layout and carries the mode-alias fix into the theme
snapshot.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Keeps white-label's per-brand generator (gamut-brand build) and drift check;
legacy's brands-layout generator is dropped. Carries the mode-alias fix and
the CSS-only sideEffects into gamut-styles.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Ports the maintainer notes from static styles' colorSystem README to the
package that now owns the generator: the pipeline, the commands that
regenerate and validate gamut's brands, and the known gaps. Notes the sandbox
parity check that isn't on this branch.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Base automatically changed from cass-gmt-1825-color-legacy-brands to cass-gmt-1825-color-brands December 3, 2026 13:31
@dreamwasp
dreamwasp force-pushed the cass-gmt-1825-color-brands branch from 99c96db to c84b86b Compare December 3, 2026 13:31
dreamwasp and others added 8 commits December 3, 2026 08:31
…s' into HEAD

# Conflicts:
#	packages/gamut-styles/src/__tests__/stylingContract.test.tsx
coreTheme no longer exists, so the gamut-docs build fails on the import.
The examples now use originalCodecademyTheme (what the themes page recommends)
and the role names for the canvas background and text.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
validate.ts measures surface roles as flat fills, so a gradient's worst
point never reached a check. worstGradientContrast samples the gradient
on a grid at alert-sized widths, composites the palette circles over the
flat fill as CSS paints them, and reports the lowest ratio against the
ink. The test asserts text-default clears 4.5:1 for every gradient role
in every brand and mode, and that white ink fails on the light gradient,
so the sampler can't pass by accident.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
The brands commit fixes how role overrides reach the emitted tokens, the
hover-to-pressed check, and the same-mode ColorMode background. In this
branch the color system lives in gamut-brand, so the emit and validate
changes are ported there. The override test moves to gamut-brand's
__tests__ with its imports unchanged.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
ResolvedValue now carries its ref. parseTokensCss rebuilt roles without
one, which broke the gamut-brand typecheck and every round-trip check.
Rebuild the ref from the var() key: palette refs keep their slot, grade
and optional alpha, and black/white keep their boundary alpha.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Storybook’s unsupported core theme defaults cause runtime crashes, and its import of the removed CoreTheme export causes a TypeScript error.

8 open issues
What changed in this PR

Moves Gamut’s color generator into @skillsoft/gamut-brand and introduces self-contained, per-brand tokens for built-in themes and custom brands. This establishes the token layout used by the subsequent component and documentation migrations.

Changes:

  • Adds a public brand API and CLI with build, watch, validation, and drift checks.
  • Splits generated assets by brand and updates theme exports and loading paths.
  • Adds generator coverage and updates Storybook, documentation, and release metadata.
File Description
yarn.lock Registers the brand workspace and dependencies.
vitest.config.ts Includes brand tests in the Node project.
packages/​variance/​src/​createTheme/​createTheme.ts Aligns color-variable typing with --color-*.
packages/​styleguide/​src/​lib/​Foundations/​ColorMode/​CssContract.stories.tsx Removes the CSS-contract spike stories.
packages/​gamut/​src/​Alert/​variants.tsx Updates a source-path comment.
packages/​gamut/​src/​Alert/​elements.tsx Revises design-reference comments.
packages/​gamut/​src/​Alert/​__tests__/​Alert.test.tsx Adds behavior and color assertions.
packages/​gamut-styles/​src/​variables/​elevation.ts Revises design-reference comments.
packages/​gamut-styles/​src/​tokens/​index.ts Exports per-brand token modules.
packages/​gamut-styles/​src/​tokens/​generated/​platform/​light.tokens.json Adds Platform’s light roles.
packages/​gamut-styles/​src/​tokens/​generated/​platform/​dark.tokens.json Adds Platform’s dark roles and overrides.
packages/​gamut-styles/​src/​tokens/​generated/​index.ts Exports all five brand namespaces.
packages/​gamut-styles/​src/​tokens/​generated/​brands/​index.ts Removes the old brand index.
packages/​gamut-styles/​src/​tokens/​generated/​admin/​light.tokens.json Adds Admin’s light roles.
packages/​gamut-styles/​src/​tokens/​__tests__/​generated.test.ts Checks output freshness and brand isolation.
packages/​gamut-styles/​src/​themes/​skillsoft.ts Uses the new generated path.
packages/​gamut-styles/​src/​themes/​platform.ts Builds Platform with editor colors.
packages/​gamut-styles/​src/​themes/​originalCodecademy.ts Updates generated imports and comments.
packages/​gamut-styles/​src/​themes/​lxStudio.ts Builds LX Studio with its existing radii.
packages/​gamut-styles/​src/​themes/​index.ts Exports rebuilt themes and the factory.
packages/​gamut-styles/​src/​themes/​createBrandTheme.ts Accepts brand CSS and initial mode.
packages/​gamut-styles/​src/​themes/​admin.ts Builds Admin from generated values.
packages/​gamut-styles/​src/​themes/​__tests__/​brandElevation.test.ts Extends elevation coverage across brands.
packages/​gamut-styles/​src/​GamutProvider.tsx Documents per-brand CSS loading.
packages/​gamut-styles/​src/​colorSystem/​README.md Removes the relocated generator documentation.
packages/​gamut-styles/​src/​colorSystem/​build.ts Removes the shared-output generator.
packages/​gamut-styles/​src/​colorSystem/​brands/​originalCodecademy.ts Removes the relocated brand definition.
packages/​gamut-styles/​src/​colorSystem/​brands/​index.ts Removes the old brand registry.
packages/​gamut-styles/​src/​colorSystem/​__tests__/​sandboxParity.test.ts Removes sandbox parity coverage.
packages/​gamut-styles/​src/​Background.tsx Updates a generator-path comment.
packages/​gamut-styles/​src/​AssetProvider.test.tsx Uses LX Studio for alternate-theme coverage.
packages/​gamut-styles/​src/​AssetProvider.fontLoading.test.tsx Tests switching between distinct themes.
packages/​gamut-styles/​src/​__tests__/​stylingContract.test.tsx Checks each theme’s own CSS.
packages/​gamut-styles/​scripts/​validate-tokens.ts Validates per-brand output through the new package.
packages/​gamut-styles/​scripts/​dump-sandbox.ts Removes sandbox fixture tooling.
packages/​gamut-styles/​scripts/​build-tokens.ts Generates brands individually and supports --check.
packages/​gamut-styles/​project.json Copies nested token assets into distribution.
packages/​gamut-styles/​package.json Updates token exports and generator dependencies.
packages/​gamut-docs/​src/​content/​docs/​guides/​theming-your-app.md Removes Percipio from the theme list.
packages/​gamut-docs/​src/​content/​docs/​guides/​creating-a-custom-theme.md Revises theme guidance and examples.
packages/​gamut-docs/​src/​content/​docs/​foundations/​themes.md Removes the Percipio entry.
packages/​gamut-docs/​src/​content/​docs/​foundations/​design-tokens/​elevation.mdx Changes the example theme name to Skillsoft.
packages/​gamut-docs/​src/​content/​docs/​concepts/​color-modes.md Removes Percipio from the palette examples.
packages/​gamut-docs/​src/​components/​GamutExample.tsx Uses Original Codecademy and semantic color roles.
packages/​gamut-brand/​tsdown.config.ts Configures ESM API and CLI builds.
packages/​gamut-brand/​tsconfig.spec.json Adds test TypeScript configuration.
packages/​gamut-brand/​tsconfig.lib.json Configures declaration output.
packages/​gamut-brand/​tsconfig.json Adds package TypeScript configuration.
packages/​gamut-brand/​src/​validate.ts Relocates checks and revises comments.
packages/​gamut-brand/​src/​system.ts Shares role-override resolution with emitters.
packages/​gamut-brand/​src/​roundTrip.ts Parses emitted CSS for validation.
packages/​gamut-brand/​src/​roles.ts Adds the typed role-name list.
packages/​gamut-brand/​src/​ramp.ts Relocates ramp generation and revises comments.
packages/​gamut-brand/​src/​probe.ts Relocates tenant probes and revises comments.
packages/​gamut-brand/​src/​migration.ts Relocates migration checks and revises comments.
packages/​gamut-brand/​src/​index.ts Exposes brand definitions and generation APIs.
packages/​gamut-brand/​src/​gradientContrast.ts Samples text contrast over gradients.
packages/​gamut-brand/​src/​generate.ts Generates, validates, writes, and checks brand assets.
packages/​gamut-brand/​src/​emit.ts Emits brand overrides and embedded CSS.
packages/​gamut-brand/​src/​contentModes.ts Computes content modes at build time.
packages/​gamut-brand/​src/​cli.ts Adds build, watch, and check commands.
packages/​gamut-brand/​src/​brands/​skillsoft.ts Relocates Skillsoft’s brand input.
packages/​gamut-brand/​src/​brands/​platform.ts Defines Platform’s dark-start brand.
packages/​gamut-brand/​src/​brands/​originalCodecademy.ts Defines shared overrides and Codecademy shadows.
packages/​gamut-brand/​src/​brands/​lxStudio.ts Defines LX Studio’s hues and overrides.
packages/​gamut-brand/​src/​brands/​index.ts Registers and exports built-in brands.
packages/​gamut-brand/​src/​brands/​admin.ts Defines Admin’s blue-primary brand.
packages/​gamut-brand/​src/​brand.ts Types overrides and adds initial mode.
packages/​gamut-brand/​src/​__tests__/​system.test.ts Checks roles, overrides, and emitted references.
packages/​gamut-brand/​src/​__tests__/​overrides.test.ts Covers override references and alpha behavior.
packages/​gamut-brand/​src/​__tests__/​gradientContrast.test.ts Checks sampled gradient contrast.
packages/​gamut-brand/​src/​__tests__/​generator.test.ts Tests ramp and role guarantees across hues.
packages/​gamut-brand/​src/​__tests__/​cli.test.ts Covers generation, drift, and rejected inputs.
packages/​gamut-brand/​README.md Documents custom-brand setup and tooling.
packages/​gamut-brand/​project.json Defines build, test, and package-verification targets.
packages/​gamut-brand/​package.json Declares public exports, CLI, and dependencies.
packages/​gamut-brand/​.gitignore Ignores build output.
packages/​gamut-agent-tools/​skills/​gamut-review/​SKILL.md Reformats Markdown tables only.
packages/​.storybook/​theming/​GamutThemeProvider.tsx Loads the selected brand’s CSS.
packages/​.storybook/​preview.ts Updates theme defaults and toolbar choices.
packages/​.storybook/​main.ts Resolves per-brand CSS imports.
packages/​.storybook/​components/​Elements/​DocsContainer.tsx Updates docs theme selection and mappings.
.changeset/​config.json Adds gamut-brand to coordinated releases.
.changeset/​color-system-white-label.md Records tooling and token-path changes.
.changeset/​color-system-tokens.md Revises the color-system release description.
.changeset/​color-system-legacy-brands.md Documents rebuilt themes and migration changes.
.changeset/​color-system-brands.md Clarifies variable naming and shadow changes.

Review effort: Balanced

skillsoftTheme,
adminTheme,
lxStudioTheme,
CoreTheme,
name: 'Theme',
description: 'Global theme for components',
defaultValue: 'skillsoft',
defaultValue: 'core',
"@types/culori": "^4"
},
"engines": {
"node": ">=20"
fsCache: false,
});
const brand = await jiti.import<BrandInput>(brandFile, { default: true });
if (!brand?.name || !brand.hues?.primary) {
Comment on lines +90 to +95
const value: ResolvedValue = {
...oklch(palette[ref[1]]),
hex: '',
key,
...refFromKey(key),
};
// nest under media query keys instead of one overwriting the other.
const Canvas = styled.div(
...(Object.values(coreTheme._variables) as CSSObject[]),
...(Object.values(originalCodecademyTheme._variables) as CSSObject[]),
Comment on lines +119 to +122
tokensCss: `${base.tokensCss}\n@layer tokens{${editorBlock(
`:root,[data-color-mode="${values.brand.initialMode}"]`,
values.brand.initialMode
)}${editorBlock(`[data-color-mode="${otherMode}"]`, otherMode)}}`,

## When a brand is refused

The build checks every text role against 4.5:1 and every border and icon role against 3:1 on the surfaces each is meant for, checks hover and selection veils on what they produce over each surface, keeps the three status colors apart, and checks 204 text and icon pairings inside 25 real components. It runs every check again on its own `tokens.css` read back, so what ships is what was checked.

@LinKCoding LinKCoding left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

npx nx run-many -t test,lint,build,verify-package -p gamut-brand gamut-styles

has a failure for nx run gamut-brand:lint

image

The last testing instructions point was confusing though, I ran it through claude and it seemed fine. This seems like the method is intended for consuming repos. LMK if you'd rather me test this more rigorously.


I do see that the tokens are generated for the brands in the repo and testing via SB was fine except for core. Core had the fontFamily error:

image

…edos)

parseTokensCss split blocks and declarations with two regexes that
CodeQL flags as polynomial (alerts #2 and #3). The input is our own
generated tokens.css, so this was not exploitable, but the alerts were
open. Split on braces and semicolons and strip comments with plain string
search instead. Same parse; the gamut-brand suite passes unchanged.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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