Skip to content

Grid

The grid object provides a 12-column layout system built on CSS Grid (with a float fallback). Wrap columns in an .obj-grid container and assign span classes to each child.

Human-readable aliases for common column widths. These are the easiest way to build layouts.

ClassWidth
.obj-grid__full100% (12 of 12)
.obj-grid__three-quarter75% (9 of 12)
.obj-grid__two-third66.66% (8 of 12)
.obj-grid__half50% (6 of 12)
.obj-grid__third33.33% (4 of 12)
.obj-grid__quarter25% (3 of 12)

Plural forms .obj-grid__two-thirds and .obj-grid__three-quarters are also supported.

For finer control, use the numeric {span}-12 pattern to specify any column count from 1 to 12.

ClassColumnsWidth
.obj-grid__1-1218.33%
.obj-grid__2-12216.66%
.obj-grid__3-12325%
.obj-grid__4-12433.33%
.obj-grid__5-12541.66%
.obj-grid__6-12650%
.obj-grid__7-12758.33%
.obj-grid__8-12866.66%
.obj-grid__9-12975%
.obj-grid__10-121083.33%
.obj-grid__11-121191.66%
.obj-grid__12-1212100%

All column classes support responsive suffixes. At narrow viewports columns default to full width; add a breakpoint suffix to apply the span from that breakpoint up.

SuffixMin-width
@sm30rem (480px)
@md50rem (800px)
@lg60rem (960px)
@xl80rem (1280px)
@printPrint media

Control spacing between grid items. Apply to the .obj-grid container.

ClassGap
.obj-grid--gap-none0
.obj-grid--gap-xs0.25rem
.obj-grid--gap-sm0.5rem
.obj-grid--gap-md1rem
.obj-grid--gap-lg1.5rem
.obj-grid--gap-xl2.5rem
.obj-grid--gap-xxl3.5rem

Use .obj-grid--column-gap-* or .obj-grid--row-gap-* to set horizontal or vertical gaps independently. All gap classes support responsive @bp suffixes.

Container-level alignment controls how items are positioned within the grid.

ClassDescription
.obj-grid--align-items-centerCenter items on the cross axis
.obj-grid--align-items-startAlign items to the start
.obj-grid--align-items-endAlign items to the end
.obj-grid--align-items-stretchStretch items to fill the row height (default)

Item-level alignment is available via .obj-grid--align-self-* and .obj-grid--jusify-self-* classes, using the same values (center, start, end, stretch). These also support responsive @bp suffixes.

Two columns at 50% width using .obj-grid__half.

Half
Half
<div class="obj-grid obj-grid--gap-md">
<div class="obj-grid__half util-background-odyssey util-pad-all-md">Half</div>
<div class="obj-grid__half util-background-creamery util-pad-all-md">
Half
</div>
</div>

Three equal columns using .obj-grid__third.

Third
Third
Third
<div class="obj-grid obj-grid--gap-md">
<div class="obj-grid__third util-background-odyssey util-pad-all-md">
Third
</div>
<div class="obj-grid__third util-background-creamery util-pad-all-md">
Third
</div>
<div class="obj-grid__third util-background-odyssey util-pad-all-md">
Third
</div>
</div>

A common pattern using .obj-grid__quarter for a sidebar and .obj-grid__three-quarter for the main content.

Sidebar (25%)
Main Content (75%)
<div class="obj-grid obj-grid--gap-md">
<div class="obj-grid__quarter util-background-creamery util-pad-all-md">
Sidebar (25%)
</div>
<div class="obj-grid__three-quarter util-background-odyssey util-pad-all-md">
Main Content (75%)
</div>
</div>

An uneven split using the numeric pattern: .obj-grid__5-12 and .obj-grid__7-12.

5 of 12
7 of 12
<div class="obj-grid obj-grid--gap-md">
<div class="obj-grid__5-12 util-background-odyssey util-pad-all-md">
5 of 12
</div>
<div class="obj-grid__7-12 util-background-creamery util-pad-all-md">
7 of 12
</div>
</div>

Multiple columns with different spans totaling 12.

2
3
4
3
<div class="obj-grid obj-grid--gap-sm">
<div class="obj-grid__2-12 util-background-odyssey util-pad-all-md">2</div>
<div class="obj-grid__3-12 util-background-creamery util-pad-all-md">3</div>
<div class="obj-grid__4-12 util-background-odyssey util-pad-all-md">4</div>
<div class="obj-grid__3-12 util-background-creamery util-pad-all-md">3</div>
</div>

Columns that stack on small screens and rearrange at larger breakpoints. Full width by default, halves at md, thirds at lg.

Column 1
Column 2
Column 3
<div class="obj-grid obj-grid--gap-md">
<div
class="obj-grid__full obj-grid__half@md obj-grid__third@lg util-background-odyssey util-pad-all-md"
>
Column 1
</div>
<div
class="obj-grid__full obj-grid__half@md obj-grid__third@lg util-background-creamery util-pad-all-md"
>
Column 2
</div>
<div
class="obj-grid__full obj-grid__half@md obj-grid__third@lg util-background-odyssey util-pad-all-md"
>
Column 3
</div>
</div>

Comparing small and large gap modifiers on the same layout.

XS gap
XS gap
XS gap
XS gap
<div class="obj-grid obj-grid--gap-xs">
<div class="obj-grid__quarter util-background-odyssey util-pad-all-sm">
XS gap
</div>
<div class="obj-grid__quarter util-background-creamery util-pad-all-sm">
XS gap
</div>
<div class="obj-grid__quarter util-background-odyssey util-pad-all-sm">
XS gap
</div>
<div class="obj-grid__quarter util-background-creamery util-pad-all-sm">
XS gap
</div>
</div>
XL gap
XL gap
XL gap
XL gap
<div class="obj-grid obj-grid--gap-xl">
<div class="obj-grid__quarter util-background-odyssey util-pad-all-sm">
XL gap
</div>
<div class="obj-grid__quarter util-background-creamery util-pad-all-sm">
XL gap
</div>
<div class="obj-grid__quarter util-background-odyssey util-pad-all-sm">
XL gap
</div>
<div class="obj-grid__quarter util-background-creamery util-pad-all-sm">
XL gap
</div>
</div>

Items of varying height centered on the cross axis using .obj-grid--align-items-center.

Short
Tall
Short
<div class="obj-grid obj-grid--gap-md obj-grid--align-items-center">
<div class="obj-grid__third util-background-odyssey util-pad-all-sm">
Short
</div>
<div
class="obj-grid__third util-background-creamery util-pad-all-md"
style="padding-top: 2rem; padding-bottom: 2rem"
>
Tall
</div>
<div class="obj-grid__third util-background-odyssey util-pad-all-sm">
Short
</div>
</div>