Layout primitives control structure and flow — how content stacks, how columns form, and how sections are contained. They work with spacing tokens (see Spacing) but serve a different purpose: spacing defines distance, layout defines arrangement.
For the full page hierarchy (body → page-wrapper → page-content → section → padding-global → container → block), see the Layout docs.
Blocks
A is a vertical flex stack with a default gap of between children. It is the fundamental building block for content layout.
Default gap
— default gap is --space-m (12px)
<div class="block">
<div>First item</div>
<div>Second item</div>
<div>Third item</div>
</div>
Gap modifiers
Add .gap-* to control spacing between children. These work on both and .
.block .gap-none
.block .gap-xs
.block .gap-s
.block .gap-l
| Class | Gap | Token |
|---|---|---|
| 0 | ||
| 4px | ||
| 8px | ||
| 12px | (default) | |
| 16px | ||
| 24px | ||
| 32px | ||
| 48px |
Horizontal row
Add to a block to switch from vertical stacking to horizontal layout. Use for right-to-left order.
.block .row .gap-xl
<div class="block row gap-xl">
<div>Left</div>
<div>Centre</div>
<div>Right</div>
</div>
Alignment modifiers
Use alignment classes on (or .block .row) to control cross-axis and main-axis positioning.
| Class | Effect |
|---|---|
align-items: flex-start |
|
align-items: center |
|
align-items: flex-end |
|
justify-content: center |
|
justify-content: flex-end |
Grid
CSS grid layout with column presets. The default is a responsive 2-column grid. Add or for more columns, and .gap-* to control gutter size.
Default (2 columns)
— default 2 columns, gap --space-m
<div class="grid">
<div>Item 1</div>
<div>Item 2</div>
<div>Item 3</div>
<div>Item 4</div>
</div>
3 columns
.grid .cols-3
<div class="grid cols-3">
<div>Item 1</div>
<div>Item 2</div>
...
</div>
4 columns with small gap
.grid .cols-4 .gap-s
| Class | Columns |
|---|---|
| 2 columns (default) | |
| 3 columns | |
| 4 columns |
Containers
Containers centre content and cap its maximum width. Use them inside sections to control content density.
— 640px
— 1040px
— 1200px
<div class="container-small">Narrow content</div>
<div class="container-medium">Standard content</div>
<div class="container-large">Wide content</div>
| Class | Max Width | Use Case |
|---|---|---|
| 640px | Long-form text, forms, narrow content | |
| 1040px | Standard page content | |
| 1200px | Dashboards, wide layouts |
Rules
- Containers add
margin-left: autoandmargin-right: auto— they centre themselves - Containers set
width: 100%so they fill available space up to the max-width - Nest containers inside for consistent page margins
Max-Width Utilities
Max-width utilities cap width without centring. Use them on individual elements that need a width constraint but should stay in normal flow.
| Class | Max Width |
|---|---|
| 640px | |
| 960px | |
| 1200px | |
| 100% |
<p class="max-width-small">This paragraph won't exceed 640px.</p>
Containers vs Max-Width
- Container = max-width + auto margins (centred)
- Max-width = max-width only (stays in flow, left-aligned)
Padding Global
adds consistent horizontal padding to the page. It is applied once per section row, wrapping the container.
<section>
<div class="padding-global">
<div class="container-medium">
<!-- Content here -->
</div>
</div>
</section>
| Class | Effect |
|---|---|
padding-left: var(--space-xl) + padding-right: var(--space-xl) |
Padding Utilities
General-purpose padding utilities for spacing inside elements.
| Class | Value | Token |
|---|---|---|
| 8px | ||
| 12px | ||
| 16px | ||
| 24px | ||
| 32px | ||
| 48px |
Key Rules
- Blocks control micro spacing (
.gap-*between children) - Grids control column layout — use
.gap-*for gutters - Containers control width and centring — never apply spacing directly to them
- Sections control macro spacing (
.top-*,.bottom-*classes) - Never mix responsibilities across layers
- Never use spacer divs or apply margins inside blocks
- Always use gap utilities for spacing between siblings, not margin on individual children