Skip to content

docs(gamut-docs): move the docs site onto the color system - #67

Open
dreamwasp wants to merge 94 commits into
cass-gmt-1825-color-behaviorfrom
cass-gmt-1825-color-site
Open

dreamwasp wants to merge 94 commits into
cass-gmt-1825-color-behaviorfrom
cass-gmt-1825-color-site

Conversation

@dreamwasp

@dreamwasp dreamwasp commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Stack 7 (top). Base: #63 (color-behavior). Moves the docs site onto the color system. Nothing above it.


Overview

Moves the rest of the gamut-docs site onto the generated color system. #59 added the Color system page; the older pages still described the old aliases (text, background, primary), the Core theme and palette names like navy and beige. This is the last PR in the color stack.

Pages rewritten

  • concepts/color-modes.md: roles instead of aliases, modes as data-color-mode attributes, and how a brand and a mode combine.
  • foundations/themes.md: the five brand themes, skillsoftTheme as the default, the shared SkillsoftTheme type, and coreTheme kept only until the move to roles is done.
  • foundations/design-tokens.md: roles vs palette colors, --color-* custom properties, and elevation drawn in shadow-key and shadow-ambient.
  • guides/supporting-dark-mode.md: roles, and Background choosing its content mode from the build-time table.
  • guides/theming-your-app.md: passing a brand theme to GamutProvider, with role-based samples.
  • guides/creating-a-custom-theme.md: replaces the hand-built createTheme palette with building a brand with @skillsoft/gamut-brand. It covers defineBrand, overrides, the CLI (--watch and --check), createBrandTheme, types and previewing in Storybook. The override example was run through generateBrand and passes.

Smaller fixes

  • Code samples use roles instead of old names: installation (and SkillsoftTheme for the Emotion theme type), build your first page, prop groups, compose and variants, best practices and the ESLint rule examples.
  • components/containers/card.mdx documents default and brand, which replace the color variants, and the interactive shadow. Its story embeds pointed at atoms-card--* ids that no longer exist; they now use containers-card--*.
  • The button pages and BarChart no longer say "navy".
  • concepts/color-system.md drops its note that Color modes still describes the old names.

The site's own colors

src/styles/gamut-core-theme.css hand-copied old Core's navy, hyper and beige into Starlight's variables. It's now gamut-theme.css, and loads @skillsoft/gamut-styles/tokens.css first. Each Starlight variable points at the palette color its Gamut role uses in that mode, so the site follows the Skillsoft brand.

Starlight switches modes with data-theme, not data-color-mode, so the roles' mode blocks don't apply and the mapping is per mode in the file. Starlight's cascade layers come after Gamut's, so its own color-scheme and base styles still win.

Not in this PR

  • The gamut plugin pages still list percipio as a --theme value. That's the plugin's own flag, so it changes with the plugin.
  • The Storybook theme pages (Foundations → Theme) are styleguide content, not this site.

Stacked on #63, with #59 merged in.


PR Checklist

  • Related to designs:
  • Related to JIRA ticket: GMT-1825
  • Version plan added/updated (docs only; gamut-docs is private)
  • 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 build gamut-docs: 154 pages build.
  2. npx nx dev gamut-docs, then switch the site between light and dark. The chrome uses Skillsoft's paper, navy and blue instead of Core's beige, navy and violet.
  3. Read Color modes, Themes, Design tokens, Supporting dark mode, Theming your app and Creating a custom theme. Check that no page names text, background, primary, navy, beige or hyper as colors.
  4. On Card, the story embeds load.

🤖 Generated with Claude Code

dreamwasp and others added 16 commits October 29, 2026 10:39
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…udio brands

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 45 roles: the shadow-* group (key, ambient, scrim) replaces backdrop.
- surface-raised is the lighter surface step, not a depth; navs and
  headers are surface-default, fields surface-raised.
- New guidance: raised surfaces take a border-subtle hairline, floating
  ones add a shadow, Card is default or brand.
- Brand role overrides need both attributes on one element.
- Elevation: old Core's hard offset for Original Codecademy, soft shadows
  elsewhere.

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

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The older color pages (color modes, design tokens, themes, supporting
dark mode, theming your app, creating a custom theme) described the old
aliases and Core theme. They now cover roles, the five brand themes and
building a brand with @skillsoft/gamut-brand. Code samples on other pages
use roles instead of old color names, Card documents its two variants,
and the site's own Starlight colors come from the Skillsoft brand's
tokens.css instead of a hand-copied Core palette.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dreamwasp and others added 2 commits November 10, 2026 09:09
Covers the variance createTheme and gamut-styles ColorMode prefixes, the
gamut-brand Style Dictionary prefix, the docs and the regenerated tokens.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Covers the variance createTheme and gamut-styles ColorMode prefixes, the
gamut-brand Style Dictionary prefix, the docs site and the regenerated tokens.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
…s' into cass-gmt-1825-color-docs

# 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
dreamwasp and others added 8 commits November 13, 2026 10:54
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)
@dreamwasp
dreamwasp marked this pull request as ready for review November 24, 2026 14:11
@dreamwasp
dreamwasp requested a review from a team as a code owner November 24, 2026 14:11
dreamwasp and others added 9 commits November 24, 2026 09:28
…lsoft-gamut into cass-gmt-1825-color-site

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Starlight now uses the skillsoft theme's families: Skillsoft Text for body,
Skillsoft Sans for accents, Roboto and Roboto Mono for system and code. The
files are the same codecademy.com/gamut assets gamut-styles serves to
consumers.

Adds an open question in astro.config.mjs: confirm the font license allows
serving these files from a public docs site before publishing.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
A disabled field fills with surface-sunken and draws its outline, label
and value in action-disabled (design's update of 2026-12-01).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dreamwasp added a commit that referenced this pull request Dec 2, 2026
…date

Brings in the stack through #67 (2d73ebf) and #53 (a16e5a3):

- Disabled fields fill with surface-sunken and draw their outline,
  label, value and chevron in action-disabled; enabled chevrons are
  text-default (#52 map, #54 components, DatePicker included).
- border-disabled splits between border-default and action-disabled in
  the color-roles codemod (#53).
- The color system page's role table lists disabled fields (#59), and
  the docs site loads the Skillsoft theme fonts (#67).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@LinKCoding
LinKCoding requested a balanced review from Copilot December 2, 2026 14:26

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

Video detection and dependency ownership bugs can add unnecessary peers or omit required ones for re-exports and optional dependencies, leaving runtime imports unresolved.

6 open issues
What changed in this PR

Moves Gamut’s documentation and site styling onto the generated color system, following the color-system documentation and component updates. The PR also expands scope-swap codemod behavior.

Changes:

  • Replaces legacy color guidance with roles, brand themes, and custom-brand generation.
  • Applies Skillsoft tokens to the docs site and updates component examples.
  • Adds conditional Video peers, usage-aware warnings, and codemod regression coverage.
File Description
packages/​gamut/​src/​Badge/​Badge.stories.tsx Uses a palette token in the custom gradient.
packages/​gamut-docs/​src/​styles/​gamut-theme.css Adds token-based site colors and fonts.
packages/​gamut-docs/​src/​styles/​gamut-core-theme.css Removes the legacy Core stylesheet.
packages/​gamut-docs/​src/​content/​docs/​guides/​theming-your-app.md Documents brand selection and role-based styling.
packages/​gamut-docs/​src/​content/​docs/​guides/​supporting-dark-mode.md Explains roles and Background’s mode selection.
packages/​gamut-docs/​src/​content/​docs/​guides/​creating-a-custom-theme.md Documents custom-brand generation and integration.
packages/​gamut-docs/​src/​content/​docs/​getting-started/​installation.md Updates provider defaults and theme typing.
packages/​gamut-docs/​src/​content/​docs/​getting-started/​build-your-first-page.md Replaces legacy background examples.
packages/​gamut-docs/​src/​content/​docs/​foundations/​themes.md Describes the five brand themes.
packages/​gamut-docs/​src/​content/​docs/​foundations/​system-props/​prop-groups.md Uses roles in color-prop examples.
packages/​gamut-docs/​src/​content/​docs/​foundations/​system-props/​compose-and-variants.md Updates the variant color example.
packages/​gamut-docs/​src/​content/​docs/​foundations/​eslint-rules.md Updates lint examples to color roles.
packages/​gamut-docs/​src/​content/​docs/​foundations/​design-tokens.md Explains palette, role, and shadow tokens.
packages/​gamut-docs/​src/​content/​docs/​concepts/​index.md Links the color-system page.
packages/​gamut-docs/​src/​content/​docs/​concepts/​color-system.md Explains generation, usage, checks, and tradeoffs.
packages/​gamut-docs/​src/​content/​docs/​concepts/​color-modes.md Explains attribute-based modes and brands.
packages/​gamut-docs/​src/​content/​docs/​concepts/​best-practices.md Recommends roles over legacy aliases.
packages/​gamut-docs/​src/​content/​docs/​components/​data-display/​bar-chart.mdx Removes navy-specific border wording.
packages/​gamut-docs/​src/​content/​docs/​components/​containers/​card.mdx Updates variants, shadows, and story embeds.
packages/​gamut-docs/​src/​content/​docs/​components/​actions/​Buttons/​text-button.mdx Generalizes dark-background guidance.
packages/​gamut-docs/​src/​content/​docs/​components/​actions/​Buttons/​stroke-button.mdx Generalizes dark-background guidance.
packages/​gamut-docs/​src/​content/​docs/​components/​actions/​Buttons/​icon-button.mdx Generalizes dark-background guidance.
packages/​gamut-docs/​src/​content/​docs/​components/​actions/​Buttons/​fill-button.mdx Generalizes dark-background guidance.
packages/​gamut-docs/​src/​content/​docs/​components/​actions/​Buttons/​cta-button.mdx Generalizes dark-background guidance.
packages/​gamut-docs/​astro.config.mjs Loads generated tokens and the new stylesheet.
packages/​gamut-codemods/​src/​video-peers.test.ts Tests Video detection and conditional peers.
packages/​gamut-codemods/​src/​transform.test.ts Adds idempotency checks and preset-specific fixtures.
packages/​gamut-codemods/​src/​presets/​scope-swap/​manifest.ts Declares conditional Video peer requirements.
packages/​gamut-codemods/​src/​presets/​scope-swap/​index.ts Adds preset hooks and dependency guidance.
packages/​gamut-codemods/​src/​presets/​manifest.test.ts Checks peer ranges against package declarations.
packages/​gamut-codemods/​src/​migrations/​tsconfig-dom/​index.ts Limits DOM warnings to Gamut usage.
packages/​gamut-codemods/​src/​migrations/​package-json/​index.ts Adds missing required peers conditionally.
packages/​gamut-codemods/​src/​migrations/​package-json/​__testfixtures__/​required-peers.output.json Defines expected added peers.
packages/​gamut-codemods/​src/​migrations/​package-json/​__testfixtures__/​required-peers.input.json Adds a missing-peer input case.
packages/​gamut-codemods/​src/​migrations/​package-json/​__testfixtures__/​peers.output.json Updates expected peer dependencies.
packages/​gamut-codemods/​src/​migrations/​package-json/​__testfixtures__/​newer-than-source.output.json Includes peers in version-warning expectations.
packages/​gamut-codemods/​src/​migrations/​package-json/​__testfixtures__/​kit.output.json Includes peers after kit expansion.
packages/​gamut-codemods/​src/​migrations/​package-json/​__testfixtures__/​already-renamed.output.json Includes peers for already-renamed dependencies.
packages/​gamut-codemods/​src/​lib/​types.ts Adds generic manifests and usage callbacks.
packages/​gamut-codemods/​src/​lib/​manifest.ts Defines required-peer metadata.
packages/​gamut-codemods/​src/​lib/​leftovers.ts Excludes generated declaration files.
packages/​gamut-codemods/​src/​lib/​gamut-imports.ts Adds cached Gamut and Video detection.
packages/​gamut-codemods/​src/​cli.ts Wires usage detection and preset hooks.
packages/​gamut-codemods/​README.md Documents peer handling and preset guidance.

Review effort: Balanced

const GAMUT_VIDEO_PATH =
/['"`](?:@codecademy|@skillsoft)\/gamut\/Video[\w/-]*['"`]/;
const IMPORT =
/import\s[^;]*?from\s*['"`]((?:@codecademy|@skillsoft)\/gamut[\w./-]*)['"`]/g;
const GAMUT_VIDEO_PATH =
/['"`](?:@codecademy|@skillsoft)\/gamut\/Video[\w/-]*['"`]/;
const IMPORT =
/import\s[^;]*?from\s*['"`]((?:@codecademy|@skillsoft)\/gamut[\w./-]*)['"`]/g;
if (listed(name)) continue;
if (video && !usesVideo()) continue;
const owner = (
['dependencies', 'peerDependencies', 'devDependencies'] as const
conditionalChecklist: {
'removed:@codecademy/gamut-kit':
"gamut-kit is gone. Delete anything that reads it for versions, such as a sync-gamut-deps script. @skillsoft/gamut-styles has @emotion/cache and stylis peer dependencies, so add them if yarn warns that they aren't provided.",
"gamut-kit is gone. Delete anything that reads it for versions, such as a sync-gamut-deps script. @skillsoft/gamut-styles needs @emotion/cache, so add it if yarn warns that it isn't provided. Don't add stylis by hand: @emotion/cache brings its own copy, and a second root copy can break style inserts.",

`GamutProvider` uses `skillsoftTheme` when you don't pass one. Every theme has the same palette keys and the same roles, so they all share one type, `SkillsoftTheme`, and a component that type-checks against one works on all of them.

`coreTheme` is still exported, on the old color names, until the move to roles is finished. Use `originalCodecademyTheme` for new work.

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.

Agreed with this comment actually

md: `0 4px 6px ${colors['shadow-secondary']}`,
}));
```sh
gamut-brand build src/theme/acme.brand.ts

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.

I also ran into this when testing the other white-labeling PR

dreamwasp and others added 3 commits December 2, 2026 14:14
The docs moved from single pages into folders on behavior. Ported the site's edits onto the new files: the two-layer color explanation and --color- variables (colors), the key and ambient shadow roles (elevation), role-based color props, and the accessing-tokens example now uses a role.

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

Create `src/presets/<name>/` with a manifest and an `index.ts`, register it in `src/presets/index.ts`, and reuse migrations from `src/migrations`.

Then document it in the `gamut-migration` skill (`packages/gamut-agent-tools/skills/gamut-migration/SKILL.md`): a row in its Presets table and a `## Preset: <name>` section. Add the same preset to the table at the top of this README. The skill's "Adding a preset" section lists what to cover.

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.

good to know, I'll update the prop name stack to include this info!

@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.

Overall, I like the updates! I gave some suggestions for doc updates.
I think for these pages, def run it by Stacey too since she'll also be making some updates and some of the points are addressed a little in her outline too.

@@ -17,7 +17,7 @@ import styled from '@emotion/styled';
const Box = styled.div(css({ p: 4 }));

// A semantic color, not a raw one

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.

semantic => role-based?
that seems to be the trend in some other edits

---
title: Themes
description: The theme palettes available (Core, Admin, LX Studio and Platform) and their values.
description: The themes Gamut ships (Skillsoft, Original Codecademy, Admin, Platform and LX Studio) and how they relate to brands.

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.

I think we could have a group discussion about shipping themes, Evan's mentioned that we might not want to support brand themes in the future -- but not sure if that was just off-the-cuff or something we should plan for

| Theme | Brand | For |
| ------------------------- | -------------------- | --------------------------------------------------------------- |
| `skillsoftTheme` | `skillsoft` | The default. Replaces `percipioTheme` |
| `originalCodecademyTheme` | `originalCodecademy` | Codecademy's public-facing product, rebuilt from the Core theme |

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.

I was wondering about the naming -- I thought the basis of this was because coreTheme was still around or that maybe codecademy was being played around with still.

could this just be codecademyTheme?

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.

will note - that one thing that threw me off about Alert was that it's no longer Codecademy themed, it has some of the SkillsoftTheme colors now, esp for light mode.


`GamutProvider` uses `skillsoftTheme` when you don't pass one. Every theme has the same palette keys and the same roles, so they all share one type, `SkillsoftTheme`, and a component that type-checks against one works on all of them.

`coreTheme` is still exported, on the old color names, until the move to roles is finished. Use `originalCodecademyTheme` for new work.

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.

Agreed with this comment actually

## When to reach for this

Most apps should [choose an existing theme](/guides/theming-your-app/) rather than build a new one — reach for a custom theme only for a genuinely new product surface that doesn't fit Core, Admin, LX Studio or Platform.
Most apps should [choose an existing theme](/guides/theming-your-app/). Build your own only when a product needs its own colors, for example to white-label Gamut for a customer.

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.

Would the audience always know what it means to "white-label"?
If not, maybe a link to an explanation would cut it


export default defineBrand({
...skillsoftBrand,
name: 'acme',

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.

consider replacing 'acme' with something even more generic - like 'customerBrandName'?

md: `0 4px 6px ${colors['shadow-secondary']}`,
}));
```sh
gamut-brand build src/theme/acme.brand.ts

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.

I also ran into this when testing the other white-labeling PR

gamut-brand build src/theme/acme.brand.ts
```

This writes `src/theme/acme/`:

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.

same note about generic company name, but will stop commenting about this after this line.

## Checking your work

Toggle color mode with Storybook's Color Mode selector while reviewing a component or page — a component built entirely from semantic aliases and system props should need no other changes to read correctly in both modes. If something looks wrong in one mode only, that's usually a raw color value that should have been a semantic alias instead.
Toggle color mode with Storybook's Color Mode selector while reviewing a component or page. A component built entirely from roles and system props should need no other changes to read correctly in both modes. If something looks wrong in one mode only, it's usually a palette color or a raw value that should have been a role. A palette color, such as `palette-neutral-light-100`, is the same in every mode, so it doesn't change when the mode does.

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.

Maybe a link to a Storybook page would be helpful here.

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