Layout primitives

Compositional building blocks for page structure. These primitives handle common layout patterns—stacking, centering, grids, sidebars—so you can compose complex layouts from simple, predictable parts.

The base + modifier pattern

All layout primitives follow a consistent base + modifier pattern:

  • Base class provides the core behavior and sets CSS custom properties
  • Modifiers only override specific variables—never set properties directly

This means you always need both the base class and any modifiers:

<!-- Correct: base + modifier -->
<div class="stack stack-compact">...</div>
<div class="box box-tight">...</div>
<section class="section section-wide">...</section>

<!-- Incorrect: modifier alone won't work -->
<div class="stack-compact">...</div>

This pattern enables:

  • Composability—stack multiple modifiers on one element
  • Container queries—base class sets up containment, modifiers respond to it
  • Predictability—modifiers only adjust, never replace, base behavior

Cover

Vertically centered full-screen panel. Great for page heroes and dramatic editorial breaks. Add a header and footer tag to anchor content to the top and bottom of the cover.

Interview

An interview with Ned Ludd

By Jeremiah Brandreth

January 12, 1814

Sidebar

Two-column layout with a fixed-width sidebar and flexible main content. Automatically stacks on narrow containers. The sidebar element is always the first child.

.sidebar (default)

Sidebar on the left, main content on the right with no gap.

.sidebar-reverse

Flips the visual order—sidebar appears on the right while remaining first in source order.

.sidebar-1px

Sidebar on the left, main content on the right with 1px gap.

.sidebar-snug

Sidebar on the left, main content on the right with single-line gap.

.sidebar-loose

Sidebar on the left, main content on the right with double-line gap.

Section

Full-width container with responsive horizontal padding and bottom padding by default. Sections with color schemes automatically add top padding when following non-scheme siblings. Use to divide pages into distinct regions with edge-to-edge backgrounds.

.section (default)

Default section

.section-wide

Reduced horizontal padding for wider content.

Wide section

.section-full-bleed

No padding—content extends to edges.

Full-bleed section

.section-spaced

Generous vertical padding for major page divisions.

Spaced section

.section-snug

Single-line vertical padding top and bottom.

Snug section

.section-tight

No vertical padding.

Vertically tight

.section-top-tight / .section-bottom-tight

Remove padding from just one edge.

Bottom tight
Top tight

Center

Horizontally centers content with a maximum width based on ideal reading measure. The go-to primitive for article text, forms, or any single-column content.

.center-narrow

Constrained to the narrow measure. Use for focused content like login forms or short-form text.

Narrow centered content

.center (default)

Standard measure (~65 characters). Optimal for body text and long-form reading.

Default centered content

.center-wide

Wide measure. Use for content that benefits from more horizontal space, like dashboards or data tables.

Wide centered content

Grid

Auto-responsive grid that adapts to available space without breakpoints. For more control, use fixed column classes with container query modifiers.

.grid (default)

Automatically responsive. Items reflow based on a minimum column width (~20rem), no breakpoints needed.

Item
Item
Item
Item
Item
Item

.grid-narrow

Narrower minimum column width for denser grids like color swatches or thumbnails.

Item
Item
Item
Item
Item
Item
Item
Item
Item

Fixed columns

Explicit column counts with container query breakpoints: @md (40rem) and @lg (60rem).

Item
Item
Item
Item
Item
Item

Column and row spans

Span items across multiple columns or rows. Spans also support container query modifiers.

Item
Item
Item
.grid-column-span-full
.grid-column-span-2
.grid-column-span-2 @md:3 @lg:4
.grid-row-span-2
.grid-row-span-2 @md:3
Item
Item
Item
Item
Item
Item
Item

Gap sizes

Control spacing between grid items.

.grid-gap-0

Item
Item
Item

.grid-gap-1px

Item
Item
Item

.grid-gap-05

Item
Item
Item

.grid (default: single-line gap)

Item
Item
Item

.grid-gap-2

Item
Item
Item

Stack

Injects consistent vertical space between child elements. The fundamental primitive for controlling vertical rhythm—use it everywhere you need evenly-spaced content flowing downward.

.stack-compact

Half-line spacing. Use for tightly related items like form fields or compact lists.

Item
Item
Item

.stack (default)

Single-line spacing. The baseline rhythm for most content.

Item
Item
Item

.stack-half

Half-line spacing. Half the baseline rhythm for tighter content.

Item
Item
Item

.stack-comfortable

Double-line spacing. Use for separating distinct content blocks or card layouts.

Item
Item
Item

.stack-spacious

Quadruple-line spacing. Use for major section breaks or hero layouts.

Item
Item
Item

Cluster

Groups items horizontally with wrapping. Perfect for navigation, tag lists, button groups, or any set of inline elements that should flow and wrap naturally.

.cluster (default)

Single-line gap, aligned to the start.

Item
Item
Item
Item
Item

.cluster-compact

Half-line gap for tighter groupings like tags or pills.

Item
Item
Item
Item
Item

.cluster-center

Centers items horizontally within the container.

Item
Item
Item

.cluster-end

Aligns items to the end (right in LTR languages).

Item
Item
Item

.cluster-between

Distributes items with equal space between them. Great for navbars with logo on one side and links on the other.

Logo
Navigation

Box

Simple padding wrapper. Use inside other primitives to add breathing room around content, especially when applying background colors.

.box.box-tight
.box
.box.box-loose