Layout

Layout starts with semantics: body > header > main > footer are the containers. Grids come in two flavours, both driven by custom properties instead of pre-generated classes.

Containers

forma-css does not ask for a wrapper class. The semantic structure itself is the layout: on every breakpoint, body > header, body > main, body > footer and any .main-container become the page containers.

From md upwards each container is centered (margin: 0 auto) and capped at the viewport width of its breakpoint: 720px from md, 960px from lg, 1200px from xl, 1400px from xxl. Below md the containers go full-bleed with only a small gutter margin. Add the .fluid class to any container to remove the cap and let it span the full window with just the half-gutter padding.

.main-container exists for nested layouts: a centered column inside a section that already has a container, or the content column of a documentation page next to a sidebar. The spacing between columns and grids is the single --forma-gutter token (1em by default): resize it and every gap follows.

.main-container centers its content at the breakpoint width, then an inner responsive-container splits it into columns.

Main content capped at 720px and centered.
Sidebar
HTML
<div class="main-container">
  <div class="responsive-container">
    <div class="responsive-column" style="--span-md:8">Main content capped at 720px and centered.</div>
    <div class="responsive-column" style="--span-md:4">Sidebar</div>
  </div>
</div>

The breakpoint system

All of the above is driven by a single map in _config.scss: $breakpoints. Each entry carries three values that the layout layer reads: the media query where the level starts (breakpoint), the maximum container width (viewport), and the root font size that the fluid typography adopts at that level (root-font-size). One map, three consequences: where the layout switches, how wide containers get, and how type scales with the screen.

$breakpoints: (
  "sm":  ( breakpoint: 600px, viewport: 540px,  root-font-size: 1.1em ),
  "md":  ( breakpoint: 768px, viewport: 720px,  root-font-size: 1.1em ),
  "lg":  ( breakpoint: 1024px, viewport: 960px, root-font-size: 1em ),
  "xl":  ( breakpoint: 1450px, viewport: 1200px, root-font-size: 1.1em ),
  "xxl": ( breakpoint: 1536px, viewport: 1400px, root-font-size: 1.2em )
);
KeyMedia queryContainer widthRoot font sizeWhat changes
sm≥ 600px540px×1.1Mobile styles with slightly larger type
md≥ 768px720px×1.1Containers appear: centered, max 720px wide
lg≥ 1024px960px×1Desktop layout, containers capped at 960px
xl≥ 1450px1200px×1.1Wide desktop, containers capped at 1200px
xxl≥ 1536px1400px×1.2Ultrawide, containers capped at 1400px

Change the map once through @use "config" with ($breakpoints: ...) and media queries, container caps and typography rescale together, because _layout.scss, the typography module and the mixins all read the same source. You will find the full build-time options in the Sass configuration page.

Selective grids

.responsive-container declares the grid size with --grid (default 12); each .responsive-column declares its width with --span and the cascade --span-sm, --span-md, --span-lg, --span-xl, --span-xxl. A column without --span spans the whole grid.

Spans accept decimal values like 2.5 – something no class-based grid system can express. The width is computed from the grid size and the gutter, so a column fits its own gap whatever --grid you set.

Grid with decimal span

The container sets --grid, each column sets --span and its per-breakpoint cascade; 6.5 or 2.5 are valid spans that no class-based grid can express.

Sidebar
Main content
Aside
HTML
<div class="responsive-container">
  <div class="responsive-column" style="--span:12; --span-md:3">Sidebar</div>
  <div class="responsive-column" style="--span-md:6.5">Main content</div>
  <div class="responsive-column" style="--span-md:2.5">Aside</div>
</div>

Massive grids

When dozens of siblings share the same layout – card walls, article lists, icon catalogs – declaring a span per column becomes noise. Flip the model: one .grid class and the --grid-columns token define how many tracks the row has, and the cascade works per grid, not per column: --grid-columns-sm, --grid-columns-md, --grid-columns-lg, --grid-columns-xl, --grid-columns-xxl. Every child simply flows into the tracks; no classes, no properties on the items.

The gap is --forma-gutter and the track count accepts any positive integer at any breakpoint. The related .display utility takes a single --display token with the same cascade (--display-md, --display-lg...) when an element needs to switch flex, grid, block or none across breakpoints without new CSS.

A card wall with one class: the grid grows from 2 to 5 tracks as the viewport climbs the breakpoint cascade. The cards carry no layout classes at all, and the .display row switches to flex from lg up, inline.

Alpha

Track 1

Beta

Track 2

Gamma

Track 3

Delta

Track 4

Epsilon

Track 5

Zeta

Track 6

The .display utility switches this row to flex from lg up, without new CSS.

HTML
<div class="grid" style="--grid-columns: 2; --grid-columns-sm: 2; --grid-columns-md: 3; --grid-columns-lg: 4; --grid-columns-xl: 5">
  <article class="card"><h4>Alpha</h4><p>Track 1</p></article>
  <article class="card"><h4>Beta</h4><p>Track 2</p></article>
  <article class="card"><h4>Gamma</h4><p>Track 3</p></article>
  <article class="card"><h4>Delta</h4><p>Track 4</p></article>
  <article class="card"><h4>Epsilon</h4><p>Track 5</p></article>
  <article class="card"><h4>Zeta</h4><p>Track 6</p></article>
</div>

<div class="display" style="--display: block; --display-lg: flex; gap: var(--forma-gutter)">
  <p class="sm">The .display utility switches this row to flex from lg up, without new CSS.</p>
</div>

Advantages

Both grid classes are one rule each: no pre-generated .col-1 ... .col-12 for five breakpoints, so the shipped CSS stays constant no matter how many different layouts the page builds. The cascade falls back to the base token, so a single --span: 6 or --grid-columns: 3 is a complete responsive declaration when that is all you need.

Customization

The gutter token --forma-gutter controls every gap at runtime. The number of columns of a responsive-container is --grid per container, so a 16-track page section needs one inline property. To change the breakpoints themselves, the viewport caps or the typography scaling, edit $breakpoints in the Sass configuration; everything else follows from that single map.