Epic CSS / Documentation

Grid

Use CSS Grid for rows and columns. Add grid for display, a column utility for the tracks, and a gap utility for spacing.

Auto-fitting columns

grid-col-3 uses repeat(auto-fit, minmax(270px, 1fr)). It fits as many columns as the available space permits; it does not force exactly three columns.

One
Two
Three
HTML
<div class="grid grid-col-3 gap-16">
  <div class="docs-demo-item">One</div>
  <div class="docs-demo-item">Two</div>
  <div class="docs-demo-item">Three</div>
</div>
ClassGenerated declaration
griddisplay: grid
grid-col-2grid-template-columns: repeat(auto-fit, minmax(331px, 1fr))
grid-col-3grid-template-columns: repeat(auto-fit, minmax(270px, 1fr))

The minimum track widths are real minimums. A container narrower than 270 or 331 pixels can overflow. Choose the utility for your available content width, rather than treating the number in its name as a guaranteed column count.

Space between tracks

gap-16 sets both row and column gap to one rem. These are the current spacer keys:

0, 4, 6, 8, 10, 12, 16, 18, 20, 24, 32, 40, 56, 60, 64, 80, 100.

The values are rem-based Sass multipliers, not a general pixel parser. In the current scale both gap-16 and gap-18 resolve to one rem.

Combine grid and grid-sidebar-left for a one-column starting layout, then select a large-screen sidebar width.

Sidebar
Main content
HTML
<div class="grid grid-sidebar-left lg-grid-sidebar-left-25 gap-24">
  <div class="docs-demo-item">Sidebar</div>
  <div class="docs-demo-item">Main content</div>
</div>
ClassLarge-screen tracks
lg-grid-sidebar-left-2525% 1fr
lg-grid-sidebar-left-3030% 1fr
lg-grid-sidebar-left-4040% 1fr

The current sidebar rules start in the 960-pixel breakpoint but are overridden back to one column through 1024 pixels. The two-track sidebar layout therefore takes effect above 1024 pixels. That is the existing output; no extra example CSS changes its behavior here.

Other existing layout helpers

left-sidebar-sm creates a grid from 756 pixels with tracks minmax(140px, auto) 1fr and a six-percent gap. grid-1fr-4fr-md uses 1fr 4fr from 820 pixels; the current sidebar override temporarily stacks it between 960 and 1024 pixels. These describe the current rules, rather than additional utilities added for the docs.

Containers and widths

ClassEffect
wrapperFive percent padding on each side.
containerCentered container with the Sass-configured maximum width, currently 1000 pixels.
container-postCentered container with a fixed maximum width of 1000 pixels.
w-100Full available width.
margin-automargin: 0 auto, resetting vertical margins and centering horizontally where the available width permits.
sm-w-25, md-w-50, lg-w-75Examples of breakpoint-prefixed 25%, 50%, and 75% widths.

The generated width prefixes are xs, sm, md, lg, and xl, using the same breakpoints as Flexbox. Percentage widths combined with gaps can exceed the parent's available width; use the auto-fitting grid where it better fits the content.