@codecademy/gamut 68.5.2-alpha.f0a056.0 → 68.6.1-alpha.e6c390.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/agent-tools/.claude-plugin/marketplace.json +16 -0
  2. package/agent-tools/.claude-plugin/plugin.json +7 -0
  3. package/agent-tools/.cursor-plugin/plugin.json +7 -0
  4. package/agent-tools/DESIGN.Codecademy.md +648 -0
  5. package/agent-tools/DESIGN.LXStudio.md +460 -0
  6. package/agent-tools/DESIGN.Percipio.md +463 -0
  7. package/agent-tools/DESIGN.md +1 -0
  8. package/agent-tools/agents/.gitkeep +0 -0
  9. package/agent-tools/commands/gamut-review.md +170 -0
  10. package/agent-tools/guidelines/components/buttons.md +44 -0
  11. package/agent-tools/guidelines/components/overview.md +44 -0
  12. package/agent-tools/guidelines/foundations/color.md +86 -0
  13. package/agent-tools/guidelines/foundations/modes.md +47 -0
  14. package/agent-tools/guidelines/foundations/spacing.md +66 -0
  15. package/agent-tools/guidelines/foundations/typography.md +50 -0
  16. package/agent-tools/guidelines/overview.md +38 -0
  17. package/agent-tools/guidelines/setup.md +42 -0
  18. package/agent-tools/rules/accessibility.mdc +69 -0
  19. package/agent-tools/skills/gamut-accessibility/SKILL.md +239 -0
  20. package/agent-tools/skills/gamut-color-mode/SKILL.md +99 -0
  21. package/agent-tools/skills/gamut-system-props/SKILL.md +181 -0
  22. package/agent-tools/skills/gamut-testing/SKILL.md +181 -0
  23. package/agent-tools/skills/gamut-theming/SKILL.md +115 -0
  24. package/agent-tools/skills/gamut-typography/SKILL.md +123 -0
  25. package/bin/commands/plugin/install.mjs +173 -0
  26. package/bin/commands/plugin/list.mjs +105 -0
  27. package/bin/commands/plugin/remove.mjs +116 -0
  28. package/bin/commands/plugin/update.mjs +49 -0
  29. package/bin/gamut.mjs +92 -0
  30. package/bin/lib/claude.mjs +52 -0
  31. package/bin/lib/cursor.mjs +40 -0
  32. package/bin/lib/figma.mjs +49 -0
  33. package/bin/lib/resolve-plugin-dir.mjs +38 -0
  34. package/bin/lib/run-command.mjs +22 -0
  35. package/package.json +11 -8
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "gamut-design-system",
3
+ "owner": {
4
+ "name": "Codecademy"
5
+ },
6
+ "metadata": {
7
+ "description": "Local marketplace for @codecademy/gamut agent tools."
8
+ },
9
+ "plugins": [
10
+ {
11
+ "name": "gamut-design-system",
12
+ "source": "./",
13
+ "description": "Gamut design system agent tools: skills and rules for AI-assisted development."
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "gamut-design-system",
3
+ "version": "0.0.1",
4
+ "description": "Gamut design system agent tools: skills and rules for AI-assisted development.",
5
+ "license": "MIT",
6
+ "keywords": ["codecademy", "gamut", "design-system", "agent-skills"]
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "gamut-design-system",
3
+ "displayName": "Gamut Design System",
4
+ "version": "0.0.1",
5
+ "description": "Gamut design system agent tools: skills and rules for AI-assisted development.",
6
+ "keywords": ["codecademy", "gamut", "design-system", "agent-skills"]
7
+ }
@@ -0,0 +1,648 @@
1
+ ---
2
+ version: alpha
3
+ name: Codecademy Design System
4
+ description: Design tokens for codecademy.com
5
+ colors:
6
+ # palette — reference hex for docs/tools; in product UI use semantic colors via Gamut theme (Emotion) / system props or Figma tokens—never paste these literals into code
7
+ hyper-500: '#3A10E5'
8
+ hyper-400: '#5533FF'
9
+ navy-900: '#0A0D1C'
10
+ navy-800: '#10162F'
11
+ navy-700: '#31374C'
12
+ navy-600: '#4C5063'
13
+ navy-500: '#686C7C'
14
+ navy-300: '#BCBEC5'
15
+ navy-200: '#E2E3E6'
16
+ navy-100: '#F5F6F7'
17
+ yellow-500: '#FFD300'
18
+ yellow-400: '#CCA900'
19
+ yellow-0: '#FFFAE5'
20
+ yellow-900: '#211B00'
21
+ green-700: '#008A27'
22
+ green-400: '#AEE938'
23
+ green-0: '#F5FFE3'
24
+ green-900: '#151C07'
25
+ red-600: '#BE1809'
26
+ red-500: '#E91C11'
27
+ red-400: '#DC5879'
28
+ red-300: '#E85D7F'
29
+ red-0: '#FBF1F0'
30
+ red-900: '#280503'
31
+ beige: '#FFF0E5'
32
+ white: '#ffffff'
33
+ black: '#000000'
34
+ # semantic aliases (light mode) — use these in code, not palette swatches or hex values
35
+ text: '{colors.navy-800}'
36
+ text-accent: '{colors.navy-900}'
37
+ text-secondary: '{colors.navy-600}'
38
+ text-disabled: '{colors.navy-500}'
39
+ background: '{colors.white}'
40
+ background-primary: '{colors.beige}'
41
+ background-contrast: '{colors.white}'
42
+ background-selected: '{colors.navy-100}'
43
+ background-hover: '{colors.navy-200}'
44
+ background-disabled: '{colors.navy-200}'
45
+ background-success: '{colors.green-0}'
46
+ background-warning: '{colors.yellow-0}'
47
+ background-error: '{colors.red-0}'
48
+ primary: '{colors.hyper-500}'
49
+ primary-hover: '{colors.hyper-400}'
50
+ primary-inverse: '{colors.yellow-500}'
51
+ secondary: '{colors.navy-800}'
52
+ secondary-hover: '{colors.navy-700}'
53
+ interface: '{colors.hyper-500}'
54
+ interface-hover: '{colors.hyper-400}'
55
+ danger: '{colors.red-500}'
56
+ danger-hover: '{colors.red-600}'
57
+ feedback-error: '{colors.red-600}'
58
+ feedback-success: '{colors.green-700}'
59
+ feedback-warning: '{colors.yellow-500}'
60
+ border-primary: '{colors.navy-800}'
61
+ border-secondary: '{colors.navy-600}'
62
+ border-tertiary: '{colors.navy-300}'
63
+ border-disabled: '{colors.navy-500}'
64
+ shadow-primary: '{colors.navy-800}'
65
+ shadow-secondary: '{colors.navy-600}'
66
+ typography:
67
+ base:
68
+ fontFamily: '"Apercu", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif'
69
+ fontSize: '1rem'
70
+ fontWeight: '400'
71
+ lineHeight: '1.5'
72
+ accent:
73
+ fontFamily: '"Suisse", "Apercu", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif'
74
+ fontSize: '0.875rem'
75
+ fontWeight: '400'
76
+ lineHeight: '1.5'
77
+ title:
78
+ fontFamily: '"Apercu", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif'
79
+ fontSize: '2.125rem'
80
+ fontWeight: '700'
81
+ lineHeight: '1.2'
82
+ hankenGrotesk:
83
+ fontFamily: '"Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif'
84
+ monospace:
85
+ fontFamily: 'Monaco, Menlo, "Ubuntu Mono", "Droid Sans Mono", Consolas, monospace'
86
+ rounded:
87
+ none: '0px'
88
+ sm: '2px'
89
+ md: '4px'
90
+ lg: '8px'
91
+ xl: '16px'
92
+ full: '999px'
93
+ spacing:
94
+ '0': '0'
95
+ '4': '0.25rem'
96
+ '8': '0.5rem'
97
+ '12': '0.75rem'
98
+ '16': '1rem'
99
+ '24': '1.5rem'
100
+ '32': '2rem'
101
+ '40': '2.5rem'
102
+ '48': '3rem'
103
+ '64': '4rem'
104
+ '96': '6rem'
105
+ components:
106
+ FillButton:
107
+ backgroundColor: '{colors.primary}'
108
+ textColor: '{colors.white}'
109
+ rounded: '{rounded.md}'
110
+ FillButton-hover:
111
+ backgroundColor: '{colors.primary-hover}'
112
+ textColor: '{colors.white}'
113
+ FillButton-danger:
114
+ backgroundColor: '{colors.danger}'
115
+ textColor: '{colors.white}'
116
+ rounded: '{rounded.md}'
117
+ FillButton-danger-hover:
118
+ backgroundColor: '{colors.danger-hover}'
119
+ textColor: '{colors.white}'
120
+ StrokeButton:
121
+ backgroundColor: 'transparent'
122
+ textColor: '{colors.secondary}'
123
+ rounded: '{rounded.md}'
124
+ CTAButton:
125
+ backgroundColor: '{colors.primary}'
126
+ textColor: '{colors.white}'
127
+ rounded: '{rounded.md}'
128
+ CTAButton-inverse:
129
+ backgroundColor: '{colors.primary-inverse}'
130
+ textColor: '{colors.secondary}'
131
+ rounded: '{rounded.md}'
132
+ TextButton:
133
+ backgroundColor: 'transparent'
134
+ textColor: '{colors.primary}'
135
+ TextButton-hover:
136
+ textColor: '{colors.primary-hover}'
137
+ Card:
138
+ backgroundColor: '{colors.background}'
139
+ rounded: '{rounded.none}'
140
+ Card-interactive:
141
+ rounded: '{rounded.md}'
142
+ Card-elevated:
143
+ backgroundColor: '{colors.background-primary}'
144
+ rounded: '{rounded.lg}'
145
+ Card-beige:
146
+ backgroundColor: '{colors.beige}'
147
+ rounded: '{rounded.lg}'
148
+ Input:
149
+ backgroundColor: '{colors.background}'
150
+ textColor: '{colors.text}'
151
+ rounded: '{rounded.md}'
152
+ Checkbox:
153
+ backgroundColor: '{colors.interface}'
154
+ rounded: '{rounded.sm}'
155
+ Checkbox-hover:
156
+ backgroundColor: '{colors.interface-hover}'
157
+ Headline:
158
+ textColor: '{colors.text-accent}'
159
+ typography: '{typography.title}'
160
+ Tag-success:
161
+ backgroundColor: '{colors.feedback-success}'
162
+ textColor: '{colors.white}'
163
+ rounded: '{rounded.sm}'
164
+ Tag-warning:
165
+ backgroundColor: '{colors.feedback-warning}'
166
+ textColor: '{colors.text}'
167
+ rounded: '{rounded.sm}'
168
+ Alert-error:
169
+ backgroundColor: '{colors.background-error}'
170
+ textColor: '{colors.feedback-error}'
171
+ Alert-success:
172
+ backgroundColor: '{colors.background-success}'
173
+ textColor: '{colors.text}'
174
+ Alert-warning:
175
+ backgroundColor: '{colors.background-warning}'
176
+ textColor: '{colors.text}'
177
+ ---
178
+
179
+ # Codecademy
180
+
181
+ This file defines the visual design tokens for codecademy.com, implemented using the Gamut design system (`@codecademy/gamut`, `@codecademy/gamut-styles`). Gamut ships 52 components with Figma ↔ code mappings via Figma Code Connect.
182
+
183
+ **Figma file**: https://www.figma.com/design/ReGfRNillGABAj5SlITalN/📐-Gamut
184
+ **Storybook**: https://gamut.codecademy.com
185
+
186
+ ---
187
+
188
+ ## Visual Theme & Atmosphere
189
+
190
+ Codecademy communicates **logic with personality** — structured and trustworthy enough for a learning platform, with creative moments that feel engaging and human. The design voice is: _"we are ruled by logic, but are creative and a bit unexpected as well."_
191
+
192
+ **Density**: Medium. Information-dense layouts use careful whitespace and strong typographic hierarchy to stay readable. Avoid cramped or overly airy layouts.
193
+
194
+ **Design philosophy**:
195
+
196
+ - Components are color mode–aware by default — never hardcode hex values for adaptive UI
197
+ - Every component works across all themes without modification
198
+ - Mobile-first responsive design built on a 12-column grid
199
+ - Accessibility is guaranteed by design: semantic color tokens meet contrast requirements per mode automatically
200
+
201
+ ---
202
+
203
+ ## Themes
204
+
205
+ Codecademy products use one of four Gamut themes, all sharing the same core visual identity. Token aliases resolve to the right values per theme automatically — components require no modification.
206
+
207
+ | Theme | Use case | Base font | Dark mode |
208
+ | ------------- | ------------------------------- | -------------- | -------------- |
209
+ | **Core** | Codecademy (default) | Apercu | ✓ light + dark |
210
+ | **Admin** | Codecademy admin tools | Apercu | ✓ light + dark |
211
+ | **Platform** | Codecademy learning environment | Apercu | ✓ light + dark |
212
+ | **LX Studio** | LX Studio application | Hanken Grotesk | light only |
213
+
214
+ The active theme is set at the app root via `<GamutProvider>`. When designing, know which theme your screen targets — it affects primary colors, font families, and available color weights.
215
+
216
+ **Font licensing**: Apercu is licensed for codecademy.com only. LX Studio uses Hanken Grotesk.
217
+
218
+ For Percipio projects, use `DESIGN.Percipio.md` from the same package instead.
219
+
220
+ ### LX Studio theme overrides
221
+
222
+ LX Studio extends Core with these differences:
223
+
224
+ **Font**: All families → `"Hanken Grotesk"` (no Apercu, no Suisse).
225
+
226
+ **Border radii** (all values shift up one step):
227
+
228
+ | Token | Core | LX Studio |
229
+ | ----- | ---- | --------- |
230
+ | `sm` | 2px | 4px |
231
+ | `md` | 4px | 8px |
232
+ | `lg` | 8px | 12px |
233
+
234
+ **Semantic color overrides (light mode)**:
235
+
236
+ | Token | Core value | LX Studio value |
237
+ | -------------------- | ------------------- | ------------------------------- |
238
+ | `primary` | hyper-500 `#3A10E5` | `#5628FE` (lxStudioPurple) |
239
+ | `primary-hover` | hyper-400 `#5533FF` | `#7955FC` (lxStudioPurpleHover) |
240
+ | `interface` | hyper-500 | hyper-500 (unchanged) |
241
+ | `feedback-success` | green-700 `#008A27` | `#06844F` (lxStudioSuccess) |
242
+ | `background-primary` | beige `#FFF0E5` | `#FAFBFC` (lxStudioBgPrimary) |
243
+ | `shadow-primary` | navy-800 | navy-200 |
244
+ | `border-primary` | navy-800 | navy-400 |
245
+ | `border-disabled` | navy-500 | navy-300 |
246
+
247
+ ---
248
+
249
+ ## Semantic Color Aliases
250
+
251
+ Use these token names when specifying colors in designs. They resolve to the correct raw value for the active theme and color mode automatically. **Never hardcode hex values** for anything that needs to adapt across modes.
252
+
253
+ ### Text
254
+
255
+ | Token | Light | Dark | Use for |
256
+ | ---------------- | -------------------------- | --------------- | --------------------------- |
257
+ | `text` | navy-800 `#10162F` at 100% | white `#ffffff` | Default body and UI text |
258
+ | `text-accent` | navy-900 `#0A0D1C` | beige `#FFF0E5` | Stronger emphasis text |
259
+ | `text-secondary` | navy-800 at 75% | white at 65% | Supporting / secondary copy |
260
+ | `text-disabled` | navy-800 at 63% | white at 50% | Disabled state labels |
261
+
262
+ ### Background
263
+
264
+ | Token | Light | Dark | Use for |
265
+ | --------------------- | ------------------ | -------------------- | --------------------------------- |
266
+ | `background` | white `#ffffff` | navy-800 `#10162F` | Default page/component background |
267
+ | `background-primary` | beige `#FFF0E5` | navy-900 `#0A0D1C` | Slightly elevated surfaces |
268
+ | `background-contrast` | white | black `#000000` | Maximum contrast surface |
269
+ | `background-selected` | navy-800 at 4% | white at 4% | Selected row / item |
270
+ | `background-hover` | navy-800 at 12% | white at 9% | Hover state overlay |
271
+ | `background-disabled` | navy-800 at 12% | white at 9% | Disabled surface |
272
+ | `background-success` | green-0 `#F5FFE3` | green-900 `#151C07` | Success state container |
273
+ | `background-warning` | yellow-0 `#FFFAE5` | yellow-900 `#211B00` | Warning state container |
274
+ | `background-error` | red-0 `#FBF1F0` | red-900 `#280503` | Error state container |
275
+
276
+ ### Interactive
277
+
278
+ | Token | Light | Dark | Use for |
279
+ | ----------------- | -------------------- | -------------------- | --------------------------------------------- |
280
+ | `primary` | hyper-500 `#3A10E5` | yellow-500 `#FFD300` | Primary CTA, links, focus rings |
281
+ | `primary-hover` | hyper-400 `#5533FF` | yellow-400 `#CCA900` | Hover state of primary interactive |
282
+ | `primary-inverse` | yellow-500 `#FFD300` | hyper-500 `#3A10E5` | Primary on a colored background |
283
+ | `secondary` | navy-800 `#10162F` | white `#ffffff` | Secondary CTA, ghost buttons |
284
+ | `secondary-hover` | navy-800 at 86% | white at 80% | Hover state of secondary interactive |
285
+ | `interface` | hyper-500 `#3A10E5` | yellow-500 `#FFD300` | UI affordances (checkboxes, toggles, sliders) |
286
+ | `interface-hover` | hyper-400 `#5533FF` | yellow-400 `#CCA900` | Hover on interface elements |
287
+ | `danger` | red-500 `#E91C11` | red-300 `#E85D7F` | Destructive actions, error states |
288
+ | `danger-hover` | red-600 `#BE1809` | red-400 `#DC5879` | Hover on danger interactive |
289
+
290
+ ### Border
291
+
292
+ | Token | Light | Dark | Use for |
293
+ | ------------------ | ------------------ | --------------- | -------------------------- |
294
+ | `border-primary` | navy-800 `#10162F` | white `#ffffff` | Strong borders, dividers |
295
+ | `border-secondary` | navy-800 at 75% | white at 65% | Medium-weight borders |
296
+ | `border-tertiary` | navy-800 at 28% | white at 20% | Subtle borders, separators |
297
+ | `border-disabled` | navy-800 at 63% | white at 50% | Disabled input borders |
298
+
299
+ ### Feedback
300
+
301
+ | Token | Light | Dark | Use for |
302
+ | ------------------ | ------------------- | ------------------- | -------------------------------- |
303
+ | `feedback-error` | red-600 `#BE1809` | red-300 `#E85D7F` | Error messages, validation |
304
+ | `feedback-success` | green-700 `#008A27` | green-400 `#AEE938` | Success messages, confirmations |
305
+ | `feedback-warning` | yellow `#FFD300` | yellow-0 `#FFFAE5` | Warning messages, caution states |
306
+
307
+ ### Shadow
308
+
309
+ | Token | Light | Dark |
310
+ | ------------------ | --------------- | ------------ |
311
+ | `shadow-primary` | navy-800 | white |
312
+ | `shadow-secondary` | navy-800 at 75% | white at 65% |
313
+
314
+ ---
315
+
316
+ ## Raw Color Palette
317
+
318
+ All colors available as static tokens regardless of color mode. Use these only when a color should be **fixed** and not adapt to dark mode.
319
+
320
+ ### Core Palette
321
+
322
+ | Name | Weights available | Notes |
323
+ | --------------- | ---------------------------- | --------------------------------------------------------------------------------- |
324
+ | `navy` | 100–900 | 100–700 are rgba transparencies of `#10162F`; 800 = `#10162F`; 900 = `#0A0D1C` |
325
+ | `white` | 100–700 | rgba transparencies of `#ffffff` (no solid white weight — use `white` for `#fff`) |
326
+ | `blue` | 0, 100, 300, 400, 500, 800 | 500 = `#1557FF` |
327
+ | `hyper` | 400, 500 | 500 = `#3A10E5` (purple-blue), 400 = `#5533FF` |
328
+ | `green` | 0, 100, 400, 700, 900 | 700 = `#008A27` |
329
+ | `yellow` | 0, 400, 500, 900 | 500 = `#FFD300` |
330
+ | `red` | 0, 300, 400, 500, 600, 900 | 500 = `#E91C11` |
331
+ | `gray` | 100, 200, 300, 600, 800, 900 | |
332
+ | `pink` | 0, 400 | 400 = `#F966FF` |
333
+ | `orange` | 100, 500 | 500 = `#FF8C00` |
334
+ | `beige` | 100 (alias: `beige`) | `#FFF0E5` |
335
+ | `black` | — | `#000000` |
336
+ | `white` (solid) | — | `#ffffff` |
337
+
338
+ **Named aliases** (shorthand for common weights):
339
+ `beige`, `blue`, `green`, `hyper`, `lightBlue`, `lightGreen`, `navy`, `orange`, `paleBlue`, `paleGreen`, `palePink`, `paleRed`, `paleYellow`, `pink`, `red`, `yellow`, `black`, `white`
340
+
341
+ ### Platform-only additions
342
+
343
+ `lightBeige` (`#FFFBF8`), `gold` (`#8A7300`), `teal` (`#006D82`), `purple` (`#B3CCFF`)
344
+
345
+ ### LX Studio additions
346
+
347
+ `lxStudioPurple` (`#5628FE`), `lxStudioPurpleHover` (`#7955FC`), `lxStudioSuccess` (`#06844F`)
348
+
349
+ ---
350
+
351
+ ## Typography
352
+
353
+ ### Typefaces
354
+
355
+ | Token | Core / Admin / Platform | LX Studio | Use for |
356
+ | ----------- | -------------------------------------------------------- | ----------------------------------------------------- | ------------------------------------------------ |
357
+ | `base` | Apercu Pro (CSS: `Apercu`) | Hanken Grotesk | All default UI text, headlines, body copy |
358
+ | `accent` | Suisse Intl Mono (CSS: `Suisse`); falls back to `Apercu` | Hanken Grotesk | Code, captions, labels, lists, technical context |
359
+ | `monospace` | Monaco, Menlo, Ubuntu Mono, Droid Sans Mono, Consolas | Monaco, Menlo, Ubuntu Mono, Droid Sans Mono, Consolas | Code editor contexts |
360
+ | `system` | System UI fonts | System UI fonts | Performance-critical surfaces |
361
+
362
+ **Apercu is licensed for codecademy.com only.** LX Studio uses Hanken Grotesk for both `base` and `accent`.
363
+
364
+ ### Rules
365
+
366
+ - **Apercu Bold** for headlines, sub-headlines, CTAs, and buttons.
367
+ - **Apercu Regular** for body text, UI labels, and menu items.
368
+ - **Apercu Italic** to emphasize text within a Regular paragraph — not Bold.
369
+ - **Suisse** sparingly: code snippets, enumerated items, quotations, captions. Reads 10–15% large for its point size — size down relative to Apercu (14px Suisse ≈ 16px Apercu visually).
370
+ - Text is **left-aligned** by default. Center-align only for short marketing headlines. Never right-align.
371
+ - Do not adjust letter-spacing.
372
+
373
+ ### Font size scale
374
+
375
+ | Token key | Size | Common use |
376
+ | --------- | ---- | ---------------------------- |
377
+ | `64` | 64px | Hero / display |
378
+ | `44` | 44px | Page titles |
379
+ | `34` | 34px | Section titles |
380
+ | `26` | 26px | Sub-section titles |
381
+ | `22` | 22px | Card titles, large UI labels |
382
+ | `20` | 20px | Secondary titles |
383
+ | `18` | 18px | Large body, intro text |
384
+ | `16` | 16px | Default body text |
385
+ | `14` | 14px | Small body, captions, labels |
386
+
387
+ ### Font weight scale
388
+
389
+ | Token | Value | Use |
390
+ | ------- | ----- | ------------------------ |
391
+ | `base` | 400 | Body text, UI labels |
392
+ | `title` | 700 | Headlines, CTAs, buttons |
393
+
394
+ ### Line height scale
395
+
396
+ | Token | Value | Use |
397
+ | ------------- | ----- | ------------------------------------------------ |
398
+ | `base` | 1.5 | Body text (150% — aim for 150–175% of font size) |
399
+ | `spacedTitle` | 1.3 | Sub-headlines and medium titles |
400
+ | `title` | 1.2 | Large headlines (aim for 100–110% of font size) |
401
+
402
+ ### Line length
403
+
404
+ Target 45–85 characters per line; 66 characters is ideal for web body text. Max 50 characters for multi-column layouts.
405
+
406
+ ---
407
+
408
+ ## Spacing Scale
409
+
410
+ All spacing is multiples of 4px, placed on an 8px grid.
411
+
412
+ | Token | Value |
413
+ | ----- | ----- |
414
+ | `0` | 0 |
415
+ | `4` | 4px |
416
+ | `8` | 8px |
417
+ | `12` | 12px |
418
+ | `16` | 16px |
419
+ | `24` | 24px |
420
+ | `32` | 32px |
421
+ | `40` | 40px |
422
+ | `48` | 48px |
423
+ | `64` | 64px |
424
+ | `96` | 96px |
425
+
426
+ ---
427
+
428
+ ## Depth & Elevation
429
+
430
+ Gamut uses border-based and shadow-based depth cues rather than a rigid z-elevation tier system.
431
+
432
+ ### Shadow tokens
433
+
434
+ Shadow props accept standard CSS `box-shadow` syntax. Always use `shadow-primary` / `shadow-secondary` color tokens so shadows remain visible in both light and dark modes.
435
+
436
+ ```
437
+ box-shadow: 0 4px 0 <shadow-primary> → Card "outline" shadow
438
+ box-shadow: 0 0 4px rgba(0,0,0,.15) → Subtle ambient shadow
439
+ ```
440
+
441
+ ### Card shadow variants
442
+
443
+ | Variant | Effect | Use for |
444
+ | ---------------- | ------------------------------------------------------ | ------------------------------ |
445
+ | `none` (default) | No shadow | Static / non-interactive cards |
446
+ | `outline` | Solid shadow on bottom + left/right using border color | Standard clickable cards |
447
+ | `patternLeft` | Decorative checker pattern on bottom + left | Stylized content cards |
448
+ | `patternRight` | Decorative checker pattern on bottom + right | Stylized content cards |
449
+
450
+ Interactive cards (`isInteractive` prop) gain a shadow on hover and `borderRadius: md`. Cards with a pattern drop the pattern on hover.
451
+
452
+ ### Z-index
453
+
454
+ | Token | Value | Use |
455
+ | --------- | ----- | ------------------ |
456
+ | `headerZ` | 15 | Global page header |
457
+
458
+ ---
459
+
460
+ ## Border Radius Scale
461
+
462
+ | Token | Value | Use |
463
+ | ------ | ----- | ------------------------------------------ |
464
+ | `none` | 0px | Square / non-interactive elements |
465
+ | `sm` | 2px | Subtle rounding, tags |
466
+ | `md` | 4px | Default buttons, inputs, interactive cards |
467
+ | `lg` | 8px | Cards, panels |
468
+ | `xl` | 16px | Large cards, modals |
469
+ | `full` | 999px | Pills, avatars, circular elements |
470
+
471
+ ---
472
+
473
+ ## Responsive Behavior
474
+
475
+ Mobile-first. Apply styles from the named breakpoint and up.
476
+
477
+ ### Breakpoints & screen sizes
478
+
479
+ | Token | Min-width | Screen dimensions | Max content | Fold height |
480
+ | -------- | --------- | ----------------- | ----------- | ----------- |
481
+ | _(base)_ | 0 | 320×480 | 288px | 440px |
482
+ | `xs` | 480px | 480×900 | 448px | 440px |
483
+ | `sm` | 768px | 768×1024 | 704px | 680px |
484
+ | `md` | 1024px | 1024×768 | 896px | 680px |
485
+ | `lg` | 1200px | 1200×900 | 1072px | 680px |
486
+ | `xl` | 1440px | 1440×900 | 1248px | 680px |
487
+
488
+ Container query variants (`c_xs` through `c_xl`) mirror these values but trigger on component container size, not viewport.
489
+
490
+ ### Grid
491
+
492
+ 12-column grid at all breakpoints. The designer specifies how many columns a section spans per breakpoint.
493
+
494
+ | Usage | Recommended values |
495
+ | --------------------- | ------------------------------------------------ |
496
+ | Horizontal margins | 64px (lg+), 48px (md), 32px (sm/xs), 16px (base) |
497
+ | Column gaps (gutters) | 32px (lg+), 24px (md), 16px (sm/xs), 8px (base) |
498
+ | Row gaps | 32px (lg+), 24px (md), 16px (sm/xs), 8px (base) |
499
+
500
+ ### Touch targets
501
+
502
+ Minimum interactive touch target: **44×44px** on mobile breakpoints.
503
+
504
+ ### Collapsing strategies
505
+
506
+ - Begin design work at 1440px (XL), then adapt to smaller sizes.
507
+ - Wider multi-column layouts collapse to fewer columns — do not simply stretch or squish.
508
+ - Elements not in an explicit lockup (e.g., catalog cards) should align on one axis (usually left) rather than fill column widths.
509
+ - Avoid dense or small components in the base (mobile) breakpoint.
510
+
511
+ ---
512
+
513
+ ## Component Library
514
+
515
+ Components are organized into three tiers:
516
+
517
+ ### Atoms — foundational, single-purpose
518
+
519
+ Badge, Button (FillButton, StrokeButton, CTAButton, TextButton, IconButton), ButtonBase, Card, Checkbox, CodeBlock, ColorMode, Drawer, FlexBox, FormGroup, GridBox, HiddenText, Icon, Input, Label, Loader, Radio, Select, Spinner, Tag, TextArea, Toggle, Tooltip
520
+
521
+ ### Molecules — composed of atoms, handle a discrete task
522
+
523
+ Alert, Anchor, Breadcrumbs, Coachmark, Disclosure, GridForm, Markdown, Menu, Modal, Pagination, Popover, ProgressBar, Table, Tabs, Toast, Toaster, Video
524
+
525
+ ### Organisms — page-level compositions
526
+
527
+ ContentContainer, GridContainer, Layout, LayoutGrid
528
+
529
+ ### Key component patterns
530
+
531
+ #### Buttons
532
+
533
+ | Variant | Component | Use for |
534
+ | ----------------- | -------------- | ----------------------------------- |
535
+ | Primary action | `FillButton` | Solid fill, high-emphasis CTA |
536
+ | Secondary action | `StrokeButton` | Outlined, secondary CTA |
537
+ | Marketing CTA | `CTAButton` | High-visibility promotional actions |
538
+ | Tertiary / inline | `TextButton` | Low-emphasis, inline text actions |
539
+ | Icon-only | `IconButton` | Compact actions with icon only |
540
+
541
+ All button variants support sizes: `small`, `normal` (default), `large`. They accept an `icon` prop (leading or trailing) and a `disabled` prop. Passing `href` renders the button as an `<a>` tag.
542
+
543
+ **States**: default → hover (`primary-hover` / `secondary-hover`) → active → disabled (`text-disabled` + `background-disabled`).
544
+
545
+ #### Cards
546
+
547
+ Cards support:
548
+
549
+ - **Background variants**: `default` (ColorMode-responsive), `white`, `yellow`, `beige` (light contexts), `navy`, `hyper` (dark contexts)
550
+ - **Shadow variants**: `none` (default), `outline`, `patternLeft`, `patternRight`
551
+ - **Interaction**: wrap in `<Anchor>` and add `isInteractive` for hover shadow + `borderRadius: md`
552
+ - **Border radius**: defaults to `none` (non-interactive); override with the `borderRadius` prop as needed
553
+
554
+ #### Color-aware components
555
+
556
+ - **`<ColorMode mode="light|dark|system">`** — wraps a subtree in an explicit color mode.
557
+ - **`<Background bg="<color>">`** — applies a background color and automatically switches the color mode inside to maintain accessible contrast. Prefer this over setting a raw `bg` prop on any content-bearing surface.
558
+
559
+ ---
560
+
561
+ ## Global Elements
562
+
563
+ | Token | Value | Use |
564
+ | -------------- | -------------------------------------- | ------------------------------- |
565
+ | `headerHeight` | 4rem (64px) base, 5rem (80px) at `md`+ | Global page header height |
566
+ | `headerZ` | 15 | Z-index for global page headers |
567
+
568
+ ---
569
+
570
+ ## Do's and Don'ts
571
+
572
+ ### Colors
573
+
574
+ - **Do** use semantic color aliases (`primary`, `text`, `background`, etc.) for any UI that must adapt to color mode or theme.
575
+ - **Do** use `<Background bg="...">` when setting a section background — it adjusts the inner color mode for contrast automatically.
576
+ - **Don't** hardcode hex values for anything adaptive.
577
+ - **Don't** use navy or white semi-transparent swatches where they may overlap unpredictably.
578
+
579
+ ### Typography
580
+
581
+ - **Do** use `title` weight (700) for headlines, CTAs, and buttons.
582
+ - **Do** keep body text at 150–175% line height for readability.
583
+ - **Do** use Suisse sparingly — as an accent for code, captions, and lists only.
584
+ - **Don't** use Apercu Bold to emphasize text _within_ a paragraph — use Italic instead.
585
+ - **Don't** adjust letter-spacing.
586
+ - **Don't** right-align text in normal circumstances.
587
+ - **Don't** center-align body paragraphs with long line lengths.
588
+
589
+ ### Layout & Spacing
590
+
591
+ - **Do** use multiples of 8px for block-element spacing (4px only for inline / typographic relationships).
592
+ - **Do** begin design work at 1440px (XL), then adapt down to each breakpoint.
593
+ - **Do** align elements to the 12-column grid.
594
+ - **Don't** stretch elements to fill wider space — maintain proper line lengths and component widths.
595
+
596
+ ### Components
597
+
598
+ - **Do** use `FillButton` for primary actions and `StrokeButton` for secondary actions.
599
+ - **Do** add `isInteractive` to any `Card` that is wrapped in an `<Anchor>`.
600
+ - **Don't** use `CTAButton` for standard UI actions — reserve it for marketing/high-visibility promotions.
601
+ - **Don't** use `<Background>` without an actual color value — it's not a neutral wrapper.
602
+
603
+ ---
604
+
605
+ ## Agent Prompt Guide
606
+
607
+ Quick color/token reference for generating or specifying UI:
608
+
609
+ | Scenario | Tokens |
610
+ | ---------------------- | ----------------------------------------------------------------------------------------------------- |
611
+ | Primary button (light) | `bg: primary (#3A10E5)`, `color: white`, `hover: primary-hover (#5533FF)` |
612
+ | Primary button (dark) | `bg: primary (#FFD300)`, `color: navy-800`, `hover: primary-hover (#CCA900)` |
613
+ | Body text | `color: text`, `font: base (Apercu Pro)`, `size: 16px`, `weight: 400`, `lineHeight: base (1.5)` |
614
+ | Headline | `color: text-accent`, `font: base`, `size: 34–64px`, `weight: title (700)`, `lineHeight: title (1.2)` |
615
+ | Caption / label | `color: text-secondary`, `font: accent (Suisse Int'l Mono)`, `size: 14px` |
616
+ | Card default | `bg: background`, `borderRadius: none` — add `isInteractive` for hover shadow + `borderRadius: md` |
617
+ | Error state | `color: feedback-error`, `bg: background-error`, `border: danger` |
618
+ | Success state | `color: feedback-success`, `bg: background-success` |
619
+ | Disabled state | `color: text-disabled`, `bg: background-disabled`, `border: border-disabled` |
620
+
621
+ ### Component token cheatsheet
622
+
623
+ ```
624
+ FillButton → bg: primary, color: white, hover: primary-hover
625
+ StrokeButton → bg: transparent, border: secondary, hover: secondary-hover
626
+ CTAButton → high-visibility; use primary-inverse on colored surfaces
627
+ Card (light) → variant: "default" | "white" | "yellow" | "beige"
628
+ Card (dark) → variant: "navy" | "hyper"
629
+ Alert (error) → uses feedback-error + background-error
630
+ Alert (success) → uses feedback-success + background-success
631
+ Alert (warning) → uses feedback-warning + background-warning
632
+ ColorMode → <ColorMode mode="light|dark|system">
633
+ Background → <Background bg="hyper"> — auto-flips color mode for contrast
634
+ ```
635
+
636
+ ---
637
+
638
+ ## Figma ↔ Code Mapping
639
+
640
+ 52 components have Code Connect entries in `packages/code-connect/`. These appear as live code snippets in Figma's inspect panel when you select a component.
641
+
642
+ Figma layer names use emojis as visual shorthand (e.g. `✏️ label`, `👁 leading icon`, `↳ trailing icon`). These map to named props in the React components.
643
+
644
+ To publish updated code snippets after changing a component:
645
+
646
+ ```
647
+ npx figma connect publish --token <your-figma-token>
648
+ ```