Repository navigation
Conversation
… color system - Brands: every brand shares one role mapping and supplies a palette, emitted under [data-brand]. Palette and role overrides go through the same checks. - originalCodecademy: old core rebuilt as a brand, with core's fonts, weights and elevation. - ColorMode sets data-color-mode and data-brand on generated themes instead of injecting role variables. - Background paints the outer mode's palette color for an alias bg. - BREAKING: --color-* variables are renamed to --colors-* (variance too); tokens.css rules live in @layer tokens. - migration.ts re-synced to gamut-sandbox c363244. Alert General moves to surface-brand-subtle. - Styling contract test across seven themes in both modes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ands # Conflicts: # packages/gamut-styles/src/colorSystem/__tests__/system.test.ts # packages/gamut-styles/src/themes/skillsoft.ts
… pairs primary with accent-alt Brands can move a gradient role's circles to another slot (`overrides.gradients`), keeping design's grades, sizes and positions. ColorSystem carries each brand's resolved gradients, and the emitters, the migration contrast checks and tokens.css read from it. A brand whose gradient differs from the default's gets a `--gradient-*` line under `[data-brand][data-color-mode]`, like a role override. Original Codecademy's two-color gradient takes accent-alt in place of the yellow accent, per design, so it reads blue to violet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ps pinning navy and beige Design feedback on the comparison page (2026-10-29), and design's migration map at sandbox 15c2195: - Status alerts (error, success, notice) put their status ink on the message, and a floating Alert's border takes the same ink. General, feature and subtle keep text-default. - The CTA follows the Alert's own color mode. Forcing it dark only made sense on the old saturated fills; on the tints, light-mode alerts get light-mode buttons. - The ported migration map is synced to 15c2195 (Alert message slot, Alert and floating-surface summaries). - Original Codecademy no longer pins navy-800 and beige. Pinned, they carried much more chroma than the generated surfaces beside them; the generated steps at their hues are used as is. Yellow stays exact. 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>
dreamwasp
left a comment
There was a problem hiding this comment.
Fixes from design feedback on the comparison pages (2026-10-29), plus design's migration map at sandbox 15c2195. Notes on the lines below.
…ndbox update Ports gamut-sandbox df33b47 (design, 2026-11-03): - backdrop is renamed shadow-scrim; shadow-key and shadow-ambient are added at design's draft alphas (key 0.16 / 0.32, ambient 0.12 / 0.24). - Brand themes draw elevation in the shadow roles, so shadows no longer render undefined. Skillsoft gets the soft raised shadow (design's Card geometry); Original Codecademy keeps old core's hard offset, with shadow-ambient transparent in both modes. - A role override can set an alpha as well as a ref, and the build emits the translucent palette values overrides introduce. - The migration map follows the sandbox: shadow-primary/secondary split onto the shadow roles, Card collapses to default and brand, overlays take a border-subtle hairline, Modal and Flyout use shadow-scrim. - The parity fixture is re-dumped at df33b47; the generator is unchanged. - The styling contract test only applies a brand's own role overrides. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dreamwasp
left a comment
There was a problem hiding this comment.
Port of design's sandbox update, 2026-11-03 (gamut-sandbox df33b47). Notes on the lines below.
…-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>
…CTA offset Design gives the Codecademy theme "the hard offset" at raised depth (sandbox df33b47, CTAButton) without its geometry. Raised is now old core's CTAButton offset at rest (-4px) and raised-hover its hover offset (-8px, with the Card lift), drawn in shadow-key. Floating surfaces and interactive cards get a visible edge in this theme too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… names its source The check that the generator reproduces design's sandbox lived only in the validate:tokens report, which CI doesn't run, and its fixture was named for one sandbox commit, so every port renamed it and edited the script. - `__tests__/sandboxParity.test.ts` compares every palette step and every role, both modes, for the default brand, and lists each difference. - `__fixtures__/sandbox.json` records its repo, branch, commit and dump date; the test names that source. - `yarn workspace @skillsoft/gamut-styles dump:sandbox <checkout>` refreshes the fixture from any sandbox checkout. On df33b47 it reproduces the old fixture exactly. - validate:tokens drops the parity section; the README says how to take a sandbox update. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolves three conflicts: - Background.tsx: take the color-system comment wording. - colorSystem/README.md: the color-system README, plus the brands and parity section from this branch. - Alert tests: the color tests move to Alert.test.tsx, where main moved the file. The color-system tests now expect the --colors- variable prefix this branch emits. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
The stack emitted --colors-* (the color scale's name) while main uses --color-*. This restores the singular prefix everywhere: the generator's Style Dictionary prefix, ColorMode's scale key, the variance package (back to main), gamut-styles, the Alert and codemod-facing names, and the docs. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
…ands # Conflicts: # packages/.storybook/preview.ts # packages/.storybook/theming/GamutThemeProvider.tsx
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)
…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)
…ion skill - next-config: removing esmExternals: false is necessary but not always enough. Build each app and fix the routes that still fail at prerender. - CI: the job that runs sync-gamut-deps fails too, so change it with the script. - resolutions: yarn why can list two lock locators after a pin, with one copy installed. Check node_modules. - tsconfig-dom: the codemod warns only where gamut is imported. - Missing peers: @vidstack/react, react-player and stylis, with the range to add by hand. - color-roles: a palette name can map to different roles by slot, so use the context in the comment. Keep each app's theme, since the choice changes the spacing scale. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> (cherry picked from commit a0f18dc)
…gration skill Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> (cherry picked from commit bb684b9)
…igration skill Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> (cherry picked from commit b35dc09)
… skill Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> (cherry picked from commit 552d148)
…ser in the gamut-migration skill Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> (cherry picked from commit 7d92c95)
There was a problem hiding this comment.
🟡 Changes recommended
The provider does not apply the selected brand at its default scope, and bare-reference overrides can reference missing alpha palette tokens, causing incorrect colors and unresolved shadows.
6 open issues
Emit palette entries for overrides with inherited alpha · New Set the selected brand on GamutProvider's default scope · New Update docs canvas background when the brand changes · New Generate mode JSON from effective brand role references · New Preserve inherited background color in same-mode wrappers · New Validate state steps using resolved role alpha values · New
What changed in this PR
Builds on #50’s generated color system with brand palettes and overrides, restoring Original Codecademy as a generated theme. It also updates Alert styling and introduces shared shadow roles.
Changes:
- Adds brand-aware token generation, theme creation, exports, and validation.
- Switches generated color modes through attributes and updates Alert gradients, status colors, and CTA behavior.
- Adds regression coverage, Storybook theme selection, and expanded migration guidance.
| File | Description |
|---|---|
packages/styleguide/src/lib/Foundations/ColorMode/CssContract.stories.tsx |
Separates surface roles from raw palette examples. |
packages/gamut/src/Alert/variants.tsx |
Defines variant gradients and status ink. |
packages/gamut/src/Alert/elements.tsx |
Adds container-sized gradients and ink styling. |
packages/gamut/src/Alert/Alert.tsx |
Passes variant styling and lets CTAs inherit mode. |
packages/gamut/src/Alert/Alert.test.tsx |
Covers message, border, and CTA colors. |
packages/gamut-styles/src/variables/elevation.ts |
Adds soft and hard-offset brand elevations. |
packages/gamut-styles/src/tokens/index.ts |
Exports named brand token sets. |
packages/gamut-styles/src/tokens/generated/values.ts |
Adds generated shadow primitives and roles. |
packages/gamut-styles/src/tokens/generated/palette.tokens.json |
Adds translucent shadow tokens. |
packages/gamut-styles/src/tokens/generated/light.tokens.json |
Updates light roles and variable-based gradients. |
packages/gamut-styles/src/tokens/generated/dark.tokens.json |
Updates dark roles and variable-based gradients. |
packages/gamut-styles/src/tokens/generated/brands/originalCodecademy.light.tokens.json |
Adds Original Codecademy light-mode JSON. |
packages/gamut-styles/src/tokens/generated/brands/originalCodecademy.dark.tokens.json |
Adds Original Codecademy dark-mode JSON. |
packages/gamut-styles/src/tokens/generated/brands/index.ts |
Exports generated Original Codecademy values. |
packages/gamut-styles/src/themes/skillsoft.ts |
Uses the shared factory and soft elevation. |
packages/gamut-styles/src/themes/originalCodecademy.ts |
Defines the restored brand theme. |
packages/gamut-styles/src/themes/index.ts |
Exports Original Codecademy’s theme. |
packages/gamut-styles/src/themes/createBrandTheme.ts |
Centralizes generated brand theme construction. |
packages/gamut-styles/src/themes/__tests__/brandElevation.test.ts |
Checks shadow roles and elevation geometry. |
packages/gamut-styles/src/remoteAssets/fonts.ts |
Maps Original Codecademy to core fonts. |
packages/gamut-styles/src/globals/Typography.tsx |
Formats the component declaration only. |
packages/gamut-styles/src/colorSystem/system.ts |
Resolves overrides and source-color distances. |
packages/gamut-styles/src/colorSystem/roles.ts |
Defines shadow roles and clarifies surface usage. |
packages/gamut-styles/src/colorSystem/README.md |
Documents brands and sandbox parity updates. |
packages/gamut-styles/src/colorSystem/migration.ts |
Syncs token and component migration mappings. |
packages/gamut-styles/src/colorSystem/emit.ts |
Emits override primitives and palette-based gradients. |
packages/gamut-styles/src/colorSystem/brands/originalCodecademy.ts |
Defines brand hues and overrides. |
packages/gamut-styles/src/colorSystem/brands/index.ts |
Registers brands for generation. |
packages/gamut-styles/src/colorSystem/brand.ts |
Adds override and source-distance types. |
packages/gamut-styles/src/colorSystem/__tests__/system.test.ts |
Covers brand overrides and validation. |
packages/gamut-styles/src/colorSystem/__tests__/sandboxParity.test.ts |
Compares generated values with design fixtures. |
packages/gamut-styles/src/colorSystem/__fixtures__/sandbox.json |
Updates reference metadata and shadow roles. |
packages/gamut-styles/src/ColorMode.tsx |
Selects generated modes and brands through attributes. |
packages/gamut-styles/src/AssetProvider.tsx |
Deduplicates font preload URLs. |
packages/gamut-styles/src/__tests__/stylingContract.test.tsx |
Checks color resolution across themes and modes. |
packages/gamut-styles/src/__tests__/AssetProvider.test.tsx |
Covers shared-file preload deduplication. |
packages/gamut-styles/scripts/validate-tokens.ts |
Validates each brand and CSS round-trip. |
packages/gamut-styles/scripts/dump-sandbox.ts |
Adds a sandbox fixture refresh command. |
packages/gamut-styles/scripts/build-tokens.ts |
Generates layered CSS and per-brand artifacts. |
packages/gamut-styles/README.md |
Clarifies the shared color-variable prefix. |
packages/gamut-styles/project.json |
Includes brand JSON in package builds. |
packages/gamut-styles/package.json |
Exports brand JSON and adds the fixture command. |
packages/gamut-agent-tools/skills/gamut-migration/SKILL.md |
Expands guidance to multiple migration presets. |
packages/gamut-agent-tools/skills/gamut-migration/NEXT_EMOTION_INTEROP.md |
Documents Next.js and Emotion interoperability. |
packages/gamut-agent-tools/skills/gamut-migration/BREAKING_CHANGES.md |
Summarizes package-scope migration changes. |
packages/gamut-agent-tools/README.md |
Introduces the expanded migration skill. |
packages/.storybook/theming/GamutThemeProvider.tsx |
Selects brand themes and canvas backgrounds. |
packages/.storybook/preview.ts |
Adds Original Codecademy to the toolbar. |
packages/.storybook/components/Elements/DocsContainer.tsx |
Adds Original Codecademy to docs theming. |
.changeset/gamut-scope-swap-skill.md |
Removes the superseded skill changeset. |
.changeset/gamut-migration-skill.md |
Records the expanded migration skill. |
.changeset/color-system-brands.md |
Records brand support and breaking token changes. |
Review effort: Balanced
| for (const tokens of Object.values(system.brand.overrides?.roles ?? {})) { | ||
| for (const o of Object.values(tokens ?? {})) { | ||
| if (typeof o === 'object' && 'alpha' in o) add(o); |
| root: pickBy( | ||
| built._variables.root, | ||
| (_, key) => !key.startsWith('--color-') |
| const background = generated | ||
| ? (generated._tokens.colors as Record<string, string>)[bg as string] | ||
| : undefined; |
| for (const mode of MODES) { | ||
| await writeFile( | ||
| join(OUT, 'brands', `${name}.${mode}.tokens.json`), | ||
| json(toDtcgMode(other, mode)) |
| bg === undefined | ||
| ? {} | ||
| : { '--color-background-current': colors[bg] as string }, |
| return typeof o === 'object' && 'alpha' in o | ||
| ? { ref: o.ref, alpha: o.alpha } |
…ate-stylis symptom Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> (cherry picked from commit 0dc47cf)
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> (cherry picked from commit 53cce61)
# Conflicts: # packages/gamut-styles/src/stylingContract.test.tsx # packages/gamut-styles/src/themes/__tests__/__snapshots__/theme.test.ts.snap # packages/gamut-styles/src/themes/brandElevation.test.ts
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Replace example components in stories with inline renders, shared meta renders, args, and decorators. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Replaces this branch's tree with the color stack as it now stands: the site branch (#67, which includes #63, #59, #54, #66, #58, #52 and #50, each merged with main through 45586df), plus the codemod branch (#53). Static styles (#69) is still out, as before. The preview's earlier head is the parent. This commit only moves the tree forward, so nothing is rewritten. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
❌ 3 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
* build: remove unused macros package and test deps title.macro hasn't been imported since the Storybook 8 move, which relies on auto-titles. Also drop babel-plugin-macros and the unused @testing-library/react-hooks and react-test-renderer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test: drop the Date pin from the Storybook setup Story tests pass unpinned and pinned to month-, year-, and leap-day edges. Unpinned, a11y checks also cover the "today" cell. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test: colocate unit tests next to their source Move every test out of __tests__/tests folders and split codemods' lib.test.ts per module. Still runs on Jest; keep tests out of builds, coverage, and npm. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test: run unit tests on Vitest Add jsdom and node Vitest projects alongside storybook, port every non-story test from Jest (and agent-tools from node:test), and run them all from one vitest:test Nx target. Jest stays installed until the next PR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * build: remove Jest Delete the Jest configs, preset, script/jest, and the nx target default. Drop the Jest packages; add jsdom directly for Vitest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * build: remove unused Babel configs babel-jest was their last reader; tsdown, Storybook (SWC), and SVGR (configFile: false) never load them. Build output is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drop vitest Nx project left over from main merge Use main's per-package test targets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * changeset --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # yarn.lock


Overview
Builds on #50 so the generated system can carry the old themes: a brand supplies only a palette, every brand shares one role mapping, and manual overrides keep colors the generator wouldn't produce. Adds
originalCodecademy, old core rebuilt as a brand. Also moves mode switches to an attribute and renames the color variables to--color-*(singular, matchingmain). Draft, stacked on #50.Brands
colorSystem/brands/—BRANDSdrives the build; every brand has to pass every check or nothing is emitted.tokens.cssemits roles once and a palette-only block per brand under[data-brand].colorSystem/brand.ts,system.ts—overrides.palette(an exact hex in place of a generated step),overrides.roles(a role repointed in one mode) andoverrides.gradients(a gradient role's circles moved to another slot, keeping design's grades, sizes and positions). Rounded to whattokens.cssprints and guarded to round-trip; unknown roles or steps throw.brand.sourcesreports how far each supplied hex lands from its nearest step.brands/originalCodecademy.ts,themes/originalCodecademy.ts:themes/createBrandTheme.ts— one factory for every brand theme;skillsoftThemeuses it too.emit.ts— brand gradients are written against palette variables (color-mix(in oklab, …)), so one gradient follows every brand (pixel diff against the old literal gradients: max 1/255).Runtime
ColorMode— on generated themes, a mode switch setsdata-color-modeanddata-brandand injects no role variables. 100 nested switches, server-rendered: 7.6 → 4.2 ms, 5 KB → 46 B of injected CSS. Old themes behave as before.Background— fixes a bug that's also onmain(see fix(gamut-styles): Background paints the outer mode's color for an alias bg #51): an aliasbgthat flips the mode painted the flipped mode's color.Breaking
variancecreateTheme, gamut-styles — color variables are--color-*, the same prefix asmain. variance'screateThemeuses thecolorprefix for the color scale, and its mode types follow it.tokens.css— all blocks inside@layer tokens, withreset, base, tokens, recipes, utilitiesdeclared up front (Panda's order). Emotion's styles stay unlayered and win.Design sync
colorSystem/migration.ts— re-synced to sandbox15c2195. Sincec363244: apendingkind for shadows, and status alerts carry their ink on the message and on a floating border.gamut/src/Alert:surface-brand-subtle.cqwradii measure the alert, not the viewport.text-<status>on the message and on a floating border. General, feature and subtle staytext-default.Tests
__tests__/stylingContract.test.tsx—css,variant,states, system props,themed,modeColorProps,_getColorValue,ColorMode,Backgroundand the mode hooks on all seven themes in both modes. Every color they write has to resolve through everyvar()to a real color.validate-tokens.ts— every check per brand, including a round-trip of each brand's roles throughtokens.css.Storybook and docs
.storybook— an "Original Codecademy (color spike)" theme option.gamut-agent-toolsskills,colorSystem/README.md, the CSS contract story —--color-*.Known gaps
text-default, following design's coded preview. Design's map still has a shared "Floating border:border-default" slot.shadow-primary, which has no role yet (design has it as pending), so shadows renderundefinedon the new themes.PR Checklist
15c2195)Testing Instructions
yarn workspace @skillsoft/gamut-styles validate:tokens→ both brands pass every check, including thetokens.cssround-trip.yarn nx test gamut-styles(281 tests),yarn nx test variance(104), andnpx jest packages/gamut/src/Alert(16).ColorModeelement: it carriesdata-color-modeanddata-brand="originalCodecademy", and its class has no--color-*role declarations.🤖 Generated with Claude Code