Repository navigation
Conversation
…t (WIP) Builds on the color system spike (gamut-sandbox PR #34; generator at dffd84b, unchanged through 4b73c2a). - tokens.css owns the color values: skillsoftTheme no longer injects the palette, so OKLCH renders through Emotion too. Mode blocks set color-scheme, color and a default --color-background-current. - Content modes decided at build time (colorSystem/contentModes.ts). Background reads theme.contentModes instead of running polished; the table matches the runtime choice on all 90 palette colors. - Design's migration map (sandbox migration.ts at 4b73c2a) ported in place of legacyAliases.ts, with its alias, role and component-slot contrast checks, run for any brand. - Alert follows design's mapping. - ColorMode, Background and Reboot fall back to the old role names, so ColorMode keeps working on every theme. gamut is typed against skillsoftTheme with no legacy names, so the gamut build still fails (284 type errors in 66 files). Findings in Base Camp gamut/color-tokens/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 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 |
React apps get the color values without loading tokens.css: the build also
writes it as a string, generated themes carry it as `tokensCss`, and
GamutProvider renders it as an Emotion global, first among its globals.
`useTokens={false}` opts out for pages that load the static file. The
static file stays for pages without React or Emotion. Storybook drops its
own injection outside the test path.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ystem # Conflicts: # yarn.lock
…om design's map Design's feedback on the drafts: inputs use surface-raised. The fields already did; an unchecked Checkbox didn't, and a disabled DatePicker never looked disabled (its `:disabled` rule is on a div). Its error ring was the raw string `feedback-error`, so it never drew. The rest comes from an audit against design's component map (sandbox df33b47) and the elevation proposal (sandbox #50): - Field placeholder `text-subtle` (the selector was `&:placeholder`), error a 2px `text-error` outline at rest, `activated` keeps `border-default`; the same in SelectDropdown, whose disabled value is `text-subtle` and whose focused selected option keeps its selected veil. - Checkbox disabled check mark and Disclosure's disabled overline are `surface-raised` knockouts. Radio's disabled ring is `border-default`; its error hover ring is `action-primary`. - FormGroupDescription `text-subtle`, Breadcrumbs separator `text-subtle`, Anchor hover `action-primary-hover` and focus rings `action-primary`. - List: hover is a veil over the row's fill, focus a ring with no fill, the first row's top rule `border-subtle`, the table header rule `border-default`, the scroll shadow `border-subtle`. - Shimmer: `surface-sunken` with a `surface-raised` sweep, no rgba. - The checker pattern (Modal, Toast, PreviewTip, DatePicker calendar) only on Original Codecademy, in `border-subtle`; the calendar gets a `border-subtle` edge. - The Core Theme page says brand themes draw shadows in shadow-key and shadow-ambient. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…spike The generator (src/colorSystem/), its scripts (build-tokens, validate-tokens), the sandbox fixture and the tenant probe are a spike, not shipped API. They move to cass-gmt-1825-color-spike, which is the full tree from this commit's parent. The generated output under src/tokens/generated/ stays here, because the runtime needs it. Removes the build-only dependencies (culori, jiti, style-dictionary). Runtime code imported nothing from colorSystem, only comments, which now point at the spike branch. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
…5-color-spike" This reverts commit 8c0fcd9.
…nerator The package README covers what ships: the token exports, tokens in the browser, naming and known limits for consumers. The colorSystem README covers the generator: pipeline, commands, what CI checks, and generator gaps. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
…ystem # Conflicts: # packages/gamut-styles/src/__tests__/Background.test.tsx
core, admin, platform, lxStudio and percipio are removed. skillsoftTheme is the only theme here; the brand themes built on the generator (originalCodecademy, then admin, platform and lxStudio) come back in the PRs that follow. Storybook's theme toolbar and docs container map to skillsoftTheme only, and the tests that compared old themes now run against skillsoftTheme. 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>
…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>
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
…section Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
…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>
There was a problem hiding this comment.
🟡 Changes recommended
Injected globals override dark-mode colors with light-mode aliases, and production bundlers can discard the CSS required by apps using useTokens={false}.
3 open issues
What changed in this PR
Introduces generated color tokens as Gamut’s shared color contract and makes skillsoftTheme the default. This foundation ships with the stacked brand and component migrations; gamut remains unbuildable until #54.
Changes:
- Adds palette generation, semantic roles, validation, and public CSS, JSON, and TypeScript exports.
- Connects the generated tokens to themes, providers, background contrast selection, and Alert styling.
- Updates Storybook, tests, consumer documentation, and migration guidance.
| File | Description |
|---|---|
packages/styleguide/src/lib/Foundations/ColorMode/CssContract.stories.tsx |
Demonstrates CSS-only modes and surfaces. |
packages/gamut/src/Alert/variants.tsx |
Maps variants to roles and a brand gradient. |
packages/gamut/src/Alert/Alert.tsx |
Applies variant gradients and icon colors. |
packages/gamut-styles/tsdown.config.ts |
Adds the tokens build entry. |
packages/gamut-styles/src/utilities/__tests__/useLogicalProperties.test.tsx |
Uses Skillsoft in logical-property tests. |
packages/gamut-styles/src/utilities/__tests__/themed.test.ts |
Tests lookups against the new theme. |
packages/gamut-styles/src/typings/theme.d.ts |
Types Emotion against SkillsoftTheme. |
packages/gamut-styles/src/tokens/index.ts |
Exports framework-independent token data. |
packages/gamut-styles/src/tokens/generated/tokensCss.ts |
Provides generated CSS for runtime injection. |
packages/gamut-styles/src/tokens/generated/tokens.css |
Defines palette variables and mode-specific roles. |
packages/gamut-styles/src/tokens/generated/light.tokens.json |
Supplies light-mode token references. |
packages/gamut-styles/src/tokens/generated/dark.tokens.json |
Supplies dark-mode token references. |
packages/gamut-styles/src/themes/skillsoft.ts |
Builds the default theme from generated tokens. |
packages/gamut-styles/src/themes/platform.ts |
Removes the legacy Platform theme. |
packages/gamut-styles/src/themes/percipio.ts |
Removes the legacy Percipio theme. |
packages/gamut-styles/src/themes/lxStudio.ts |
Removes the legacy LX Studio theme. |
packages/gamut-styles/src/themes/index.ts |
Exports Skillsoft instead of legacy themes. |
packages/gamut-styles/src/themes/core.ts |
Removes the legacy Core theme. |
packages/gamut-styles/src/themes/admin.ts |
Removes the legacy Admin theme. |
packages/gamut-styles/src/themes/__tests__/theme.test.ts |
Switches theme snapshot coverage to Skillsoft. |
packages/gamut-styles/src/remoteAssets/fonts.ts |
Maps Skillsoft to the Percipio font assets. |
packages/gamut-styles/src/index.ts |
Changes the default theme export. |
packages/gamut-styles/src/globals/Typography.tsx |
Accepts the shared Emotion theme type. |
packages/gamut-styles/src/globals/Reboot.tsx |
Uses roles with legacy-name fallbacks. |
packages/gamut-styles/src/GamutProvider.tsx |
Defaults to Skillsoft and injects token CSS. |
packages/gamut-styles/src/colorSystem/validate.ts |
Checks contrast and content-mode guarantees. |
packages/gamut-styles/src/colorSystem/system.ts |
Resolves brand inputs into palettes and roles. |
packages/gamut-styles/src/colorSystem/roles.ts |
Defines semantic roles and gradient data. |
packages/gamut-styles/src/colorSystem/README.md |
Documents generation, checks, and known gaps. |
packages/gamut-styles/src/colorSystem/ramp.ts |
Generates graded OKLCH color ramps. |
packages/gamut-styles/src/colorSystem/probe.ts |
Reports tenant contrast and status separation. |
packages/gamut-styles/src/colorSystem/emit.ts |
Produces JSON tokens and TypeScript constants. |
packages/gamut-styles/src/colorSystem/contentModes.ts |
Precomputes content modes for palette colors. |
packages/gamut-styles/src/colorSystem/brands/skillsoft.ts |
Supplies Skillsoft’s brand hues. |
packages/gamut-styles/src/colorSystem/brand.ts |
Defines brand inputs and missing-hue derivation. |
packages/gamut-styles/src/colorSystem/__tests__/system.test.ts |
Tests guarantees and generated-output consistency. |
packages/gamut-styles/src/ColorMode.tsx |
Supports role names with legacy fallbacks. |
packages/gamut-styles/src/Background.tsx |
Uses precomputed content modes when available. |
packages/gamut-styles/src/AssetProvider.tsx |
Defaults to Skillsoft and deduplicates font preloads. |
packages/gamut-styles/src/__tests__/testUtils.tsx |
Uses Skillsoft in the shared test provider. |
packages/gamut-styles/src/__tests__/GamutProvider.test.tsx |
Covers token injection and opt-outs. |
packages/gamut-styles/src/__tests__/GamutProvider.csp.test.tsx |
Uses Skillsoft for nonce coverage. |
packages/gamut-styles/src/__tests__/fontLoading.test.tsx |
Moves font-loading tests to Skillsoft. |
packages/gamut-styles/src/__tests__/Background.test.tsx |
Tests generated palette and semantic backgrounds. |
packages/gamut-styles/src/__tests__/AssetProvider.test.tsx |
Covers Skillsoft defaults and preload deduplication. |
packages/gamut-styles/scripts/validate-tokens.ts |
Checks reference parity and CSS round-tripping. |
packages/gamut-styles/scripts/build-tokens.ts |
Validates and writes generated token outputs. |
packages/gamut-styles/README.md |
Documents token exports and browser setup. |
packages/gamut-styles/project.json |
Packages CSS/JSON assets and adjusts verification. |
packages/gamut-styles/package.json |
Adds token exports and generator dependencies. |
packages/gamut-agent-tools/skills/gamut-migration/SKILL.md |
Expands migration guidance across codemod presets. |
packages/gamut-agent-tools/skills/gamut-migration/NEXT_EMOTION_INTEROP.md |
Carries Next.js interoperability guidance under the renamed skill. |
packages/gamut-agent-tools/skills/gamut-migration/BREAKING_CHANGES.md |
Carries scope-migration notes under the renamed skill. |
packages/gamut-agent-tools/README.md |
Points consumers to the broader migration skill. |
packages/.storybook/theming/GamutThemeProvider.tsx |
Uses Skillsoft backgrounds and token CSS. |
packages/.storybook/systemProps.ts |
Sources control tokens from Skillsoft. |
packages/.storybook/preview.ts |
Makes Skillsoft the sole toolbar theme. |
packages/.storybook/main.ts |
Resolves token subpaths to source files. |
packages/.storybook/components/Elements/DocsContainer.tsx |
Moves the docs container to Skillsoft. |
.prettierignore |
Excludes generated token outputs. |
.changeset/gamut-scope-swap-skill.md |
Removes the superseded skill release note. |
.changeset/gamut-migration-skill.md |
Adds the migration skill release note. |
.changeset/color-system-tokens.md |
Records token exports and theme migration changes. |
Review effort: Balanced
| join(__dirname, '../../tokens/generated/tokens.css'), | ||
| 'utf8' | ||
| ); | ||
| expect(tokensCss).toBe(css); |
…gration skill Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
…igration skill Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
… skill Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
…ser in the gamut-migration skill Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
LinKCoding
left a comment
There was a problem hiding this comment.
Just some cleanup around theme - since skillsoftheme is the only one being exported anymore.
But overall, the flow makes sense and the new tooling is cool!
| lxStudio: lxStudioTheme, | ||
| percipio: percipioTheme, | ||
| platform: platformTheme, | ||
| skillsoft: skillsoftTheme, |
There was a problem hiding this comment.
this whole file could generally be cleaned up and hardcoded to just be skillsoftTheme
There was a problem hiding this comment.
I reintroduce other themes in the next PR - #52
| const themeBackground: Record<ColorModes, 'white' | 'navy'> = { | ||
| light: 'white', | ||
| dark: 'navy', | ||
| /* The skillsoft theme's surface-default values, as palette colors. */ |
| lxStudio: lxStudioTheme, | ||
| percipio: percipioTheme, | ||
| platform: platformTheme, | ||
| skillsoft: skillsoftTheme, |
There was a problem hiding this comment.
could simplify themeMap here too
| name: 'Theme', | ||
| description: 'Global theme for components', | ||
| defaultValue: 'core', | ||
| defaultValue: 'skillsoft', |
There was a problem hiding this comment.
Could probably be removed altogether, unless the idea is that we add back support to some themes (but that doesn't seem to be the case)
There was a problem hiding this comment.
we are adding back themes
| percipio: percipioTheme, | ||
| lxStudio: lxStudioTheme, | ||
| }; | ||
| const themes = { skillsoft: theme }; | ||
|
|
||
| const cases = Object.entries(themes).flatMap(([name, t]) => |
There was a problem hiding this comment.
these cases and the it.each block can be simplified if we're just testing against skillsoftTheme only
There was a problem hiding this comment.
we are adding back themes
| }).not.toThrow(); | ||
| }); | ||
|
|
||
| it('should handle rapid theme changes without errors', () => { |
There was a problem hiding this comment.
Is this an accurate these anymore?
cause it's the same theme now
const typedPercipioTheme = skillsoftTheme as any;
| import { createEmotionCache } from '../cache'; | ||
| import { GamutProvider, useNonce } from '../GamutProvider'; | ||
| import { coreTheme as theme } from '../themes'; | ||
| import { skillsoftTheme, skillsoftTheme as theme } from '../themes'; |
There was a problem hiding this comment.
This import can be cleaned up
| @@ -0,0 +1,140 @@ | |||
| /* eslint-disable @skillsoft/gamut/no-inline-style -- these stories show plain CSS with no Emotion, so inline styles are the point. */ | |||
There was a problem hiding this comment.
just a quick note that this will have to move since styleguide got cut
…ate-stylis symptom Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Merges main (through 45586df) into the color system branch. - Test files moved beside their sources (#79) and use Vitest (#80). The branch's style tests keep their own content, re-pointed at the new locations, with theme and mock names unchanged. - Modal, Tabs and other main-side story migrations merge clean. - gamut's components are not migrated on this branch (that is #54), so gamut's type check still reports the 284 old-name errors recorded in the spike. This commit's gate is gamut-styles. Co-Authored-By: Claude Haiku 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>
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
…ft check - Filter --color-* out of _variables.mode as well as _variables.root, so the light-mode aliases no longer override tokens.css on a dark root. - Mark **/*.css as side-effectful instead of the whole package, so bundlers keep `import '@skillsoft/gamut-styles/tokens.css'` while JS stays tree-shakeable. - Move the Style Dictionary pipeline into colorSystem/build.ts and test that a fresh generation matches the checked-in tokens, so generator drift fails CI. - Drop the duplicate `skillsoftTheme as theme` alias in GamutProvider.test. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
…echeck The lib build ran tsc over src/colorSystem/build.ts, which imports style-dictionary. Its types don't resolve under the package's moduleResolution, so `nx build gamut-styles` failed. Nothing in the library imports the generator (only the token script and its drift test), so exclude it. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
…ckground The jsdom setup already registers the Emotion matchers for every test. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
… directly The CSS generator lived inside buildTokens, so the only way to get tokens.css was to write the whole output directory. Move it into css.ts as generateTokensCss(system), which returns the file contents. Drift checks now compare the generator output with the checked-in tokens.css directly, in the color system test and in validate:tokens. The existing copy check (tokensCss.ts vs tokens.css) and the full-directory regeneration check stay in place. css.ts is excluded from the library typecheck alongside build.ts, since it imports style-dictionary. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
The drift test built its own path to the generated folder; use the readGenerated helper the other tests already share. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>



Overview
Adds the generated color system from design's sandbox to gamut-styles: an OKLCH palette (8 slots × 11 grades) and 43 semantic roles in light and dark. The output is checked in as static
tokens.css, DTCG-shaped JSON and TS constants. Static CSS owns every color value; the Emotion theme only names them.Draft: gamut doesn't build yet (284 type errors in 66 files), because components still use the old color names. #54 moves them. gamut-styles typechecks with no errors.
Ships with the stack. Land this PR together with the PRs stacked on it: #52, then #58, #54, #59, #63, #66 and #67. They need to pass CI as one set. The
buildcheck stays red until #54 is in, because gamut doesn't compile before then. The full preview is #73.Color system
gamut-styles/src/colorSystem: the generator. A brand's hues go in; the palette and roles come out.validate:tokenschecks parity with design's reference fixture (88 rungs, every role) and the contrast guarantees.contentModes.ts: which mode's content sits on each palette color, decided at build time. Matches whatBackgroundpicked at runtime on all 90 colors.migration.ts: design's old → new color map and per-component slots. Checked for every brand: 32 aliases mapped once, 200 text and icon pairings clear their tier.packages/gamut-styles/src/colorSystem/README.md: the generator's pipeline, commands, CI coverage and known gaps.packages/gamut-styles/README.md: the color tokens for consumers (exports, tokens in the browser, naming, known limits).Outputs
src/tokens/generated/:tokens.css, the same CSS as a string (tokensCss.ts), the DTCG-shaped JSON files andvalues.ts, all checked in.build:tokenswrites them and refuses to emit if a check fails.@skillsoft/gamut-styles/tokens,/tokens.css,/tokens/*.tokens.json: new exports. Thetokensentry has no React or Emotion dependency.Theme and runtime
themes/skillsoft.ts: the new default theme, built from the generated values. It carriestokens.cssastokensCss, andGamutProviderinjects it through Emotion by default (useTokens={false}opts out).typings/theme.d.ts,GamutProvider,AssetProvider: gamut is typed against and defaults toskillsoftTheme.Background: readstheme.contentModeswhen the theme has it, and keeps polished's contrast math as the fallback for themes without it.ColorMode,globals/Reboot:roleOrasks for the new role name and falls back to the old one, for brand themes that define old names.remoteAssets/fonts.ts: the skillsoft theme loads its own fonts instead of Percipio's.Agent skills
gamut-agent-toolsskill renamed fromgamut-scope-swaptogamut-migration. It covers every@skillsoft/gamut-codemodspreset: a presets table, one workflow, a section per preset (scope-swap,color-roles), and guidance for documenting a new preset. The agent-tools README points to it.Components and Storybook
gamut/src/Alert: design's mapping: status tints, an icon color per variant, the brand gradient on Feature, and aborder-defaultfloating border..storybook: the theme toolbar offers Skillsoft only.GamutProviderinjectstokens.cssfor it.styleguide: Foundations / Color system / CSS contract. Plain-CSS modes, CSS-only surfaces, and gamut components inside a CSS-only dark subtree.Dependencies
Three gamut-styles devDependencies, used only by the build scripts. None of them is in
dist:culori: the generator's color math (OKLCH and sRGB conversion, the gamut boundary, WCAG contrast, ΔE 2000, color-blindness simulation).style-dictionary(pinned at 5.7.0): renderstokens.cssfrom the DTCG files.jiti: runs the TypeScript scripts (build:tokens,validate:tokens) without a compile step.Stacked PRs: #52 builds on this, and #66 moves the generator into
@skillsoft/gamut-brandso a team can build its own brand.PR Checklist
Testing Instructions
Foundation only: gamut-styles.
gamutdoesn't compile until #54, so skip gamut tests and Storybook here. The full stack is in #73.yarn workspace @skillsoft/gamut-styles validate:tokens→ "all checks pass".yarn workspace @skillsoft/gamut-styles build:tokens, thengit status→ no changes.yarn nx test gamut-styles→ 13 suites, 206 tests pass.🤖 Generated with Claude Code
Build:
yarn buildfails on this PR:gamut:buildtype-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).