Gamut ColorMode
Source: @codecademy/gamut-styles — packages/gamut-styles/src/ColorMode.tsx
Overview
Gamut's color system uses semantic aliases instead of raw color tokens. This means components automatically adapt across light and dark modes without configuration.
Semantic color aliases
| Alias | Purpose |
| ------------ | ------------------------------------------ |
| text | Standard text color for all type |
| background | Base background color |
| primary | Interactive elements with primary action |
| secondary | Interactive elements with secondary action |
This set is not exhaustive (e.g. text-accent, background-disabled, danger — see the light/dark tables in Storybook).
Key principle: Always use these aliases in component styles — never hardcode specific color tokens like navy-400 for anything that needs to change per mode.
Storybook: Foundations / ColorMode — interactive reference. Meta / Best practices — semantic tokens, css / variant / states, and system props with ColorMode.