Gamut layout

From Codecademy/gamut · View interactive version

Gamut layout is an AI agent skill from the GitHub repository Codecademy/gamut. Use this skill when applying Gamut spacing scale, border radii, responsive breakpoints (viewport or container), or the page layout grid (LayoutGrid vs GridBox) — including responsive prop patterns and mobile-first design. Complements gamut-system-props for system.space and responsive props.

How to use this skill

Skill file

Gamut Layout

Token values match packages/gamut-styles/src/variables (spacing.ts, borderRadii.ts, responsive.ts). Breakpoints and max-content widths align with Storybook Foundations / Layout.

See also: CODE0 — system.space, responsive Box / FlexBox / GridBox props. Meta / Best practices — responsive examples.

System props for spacing

Gamut layout primitives (Box, FlexBox, GridBox, …) expose margin, padding, and gap props backed by system.space from @codecademy/gamut-styles. Pass spacing scale numbers (4, 8, 16, …), not raw pixel strings. For custom styled components, compose system.space.

Responsive behavior: All those props accept mobile-first object ({ _: 8, md: 24 }) or array syntax per Responsive properties. Container queries use keys c_base, c_xs, … c_xl; the parent must set a container (e.g. containerType="inline-size" on FlexBox). Prefer a media-query fallback when mixing c_* with viewport breakpoints.

Two different “grids”

Designer vs code names: Figma / Layout docs often label artboards XL, LG, MD, SM, XS, Base. In code, viewport breakpoints are xl, lg, md, sm, xs (min-widths below); _ is the base (no min-width query).

Spacing scale

All spacing is multiples of 4px on an 8px grid.

| Token | Value |

| ----- | ----- |

| 0 | 0 |

| 4 | 4px |

| 8 | 8px |

| 12 | 12px |

| 16 | 16px |

| 24 | 24px |

| 32 | 32px |

| 40 | 40px |

| 48 | 48px |

| 64 | 64px |

| 96 | 96px |

Use multiples of 8px for block-element spacing. Use 4px only for inline or typographic relationships.

Border radius

| Token | Value | Use |

| ------ | ----- | ---------------------------------- |

| none | 0px | Square / non-interactive elements |

| sm | 2px | Subtle rounding, tags |

| md | 4px | Buttons, inputs, interactive cards |

| lg | 8px | Cards, panels |

| xl | 16px | Large cards, modals |

| full | 999px | Pills, avatars, circular elements |

Breakpoints

Mobile-first. Styles apply from the named breakpoint and up.

| Token | Min-width | Max content width |

| -------- | --------- | ----------------- |

| _(base)_ | 0 | 288px |

| xs | 480px | 448px |

| sm | 768px | 704px |

| md | 1024px | 896px |

| lg | 1200px | 1072px |

| xl | 1440px | 1248px |

Container query breakpoints

Container keys (c_*) use the same min-width numbers as viewport breakpoints, but they apply to the width of a CSS containment context (usually a parent), not the browser viewport.

| Key | Min container width |

| -------- | ------------------- |

| c_base | 1px |

| c_xs | 480px |

| c_sm | 768px |

| c_md | 1024px |

| c_lg | 1200px |

| c_xl | 1440px |

Requirements:

When to use which:

Page layout grid (12 columns)

12-column grid at all breakpoints.

| Property | xl/lg | md | sm/xs | base |

| ------------------ | ----- | ---- | ----- | ---- |

| Horizontal margins | 64px | 48px | 32px | 16px |

| Column gutters | 32px | 24px | 16px | 8px |

| Row gaps | 32px | 24px | 16px | 8px |

Minimum touch target on mobile: 44×44px — see CODE0.

Responsive rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.