Community CSS Snippet

The 12-Column Grid I Keep, With Named Areas and Container Queries

I rewrote our marketing site grid three times before settling on this: a 12-column CSS Grid with named areas for the hero shape, container queries for the breakpoints, and custom properties for the gutter so designers can change one value.

The 12-Column Grid I Keep, With Named Areas and Container Queries

I rewrote our marketing site grid three times before settling on this: a 12-column CSS Grid with named areas for the hero shape, container queries for the breakpoints, and custom properties for the gutter so designers can change one value.

CSS
Frontend
3 snippets
css-grid
css-variables
code-template
frontend
lucasmoreau

By @lucasmoreau

January 11, 2026

·

Updated May 20, 2026

1,143 views

15

4.4 (13)

The whole layout fits on a screen because every decision is exposed as a custom property. --gutter is the single value designers ask to change, and threading it through gap, padding-inline, and any nested grid keeps everything aligned. The minmax(0, 1fr) (rather than just 1fr) is the line I always forget at first; without it, a long unbroken word in a child element forces the column wider than its share, which on a 12-column grid means columns 7-12 silently overflow the viewport. Naming columns col-span-N rather than the more recent grid-column: span var(--span) choice was deliberate: designers grep classes faster than they parse arbitrary properties.