Section Grid
Overview
A grid of bordered cells for inside a .bordered-section — a strip of summary figures across the top of a page, a label/value matrix, a summary column beside detail rows. Always pair .section-grid with a column count.
A grid that is a direct child of the section cancels the padding the section put around it, so its dividers run wall to wall instead of stopping short of the edge. Cells carry no fill of their own, so the section's white shows through and the rules are the only structure.
Guidelines
Dos
- Pair
.section-gridwith a column count. On its own it falls back to two columns and the first row keeps a top border. - Give the grid exactly as many cells as the column count when you want a single row.
- Add
.section-grid-dividedwhen the cells are peers being compared — separate figures, or the columns of a matrix. - Use
.section-grid-headerfor the labels of a matrix, not for a summary strip. - Chain a responsive count so a wide strip becomes a stack on a phone —
section-grid-1 section-grid-sm-3.
Don’ts
- Don’t nest a
.section-gridinside another one. Use a wider column count instead. - Don’t put a grid in a section that is mostly prose — the dividers imply a comparison that is not there.
- Don’t reach for
.section-grid-dividedon a single-column grid. There is nothing to divide, and the horizontal rules between rows are already doing the work. - Don’t add your own padding to a cell. The cell's horizontal padding is tied to the section's, which is what makes a flush grid line up with the heading above it.
Classes
| Class | Description |
|---|---|
.section-grid | Grid container. Sits directly inside .bordered-section. |
.section-grid-1 … .section-grid-6 | Equal-width column count (1–6). Pair one with .section-grid. |
.section-grid-{bp}-{n} | Responsive equal-width column count. bp is a breakpoint (xs, sm, md, lg, xl); n is 1–6. Applies from that breakpoint up, and chains with a base count. |
.section-grid-30-70, .section-grid-40-60, .section-grid-60-40, .section-grid-70-30 | Two columns at a fixed ratio. |
.section-grid-aside | Two columns with a narrow first column, for a summary beside detail rows. |
.section-grid-divided | Adds vertical rules between the columns. |
.section-grid-cell | A single cell. The first row has no top border. |
.section-grid-cell.section-grid-header | A filled gray header cell. |
Where the edges land
The grid negates the section's padding, so how far it reaches depends on where it sits:
- Sides — always to the section's edges.
- Top — only when the grid is the section's first child. A grid under a heading keeps the space below that heading.
- Bottom — only when it is the last child.
- Rounded corners — only when the grid is the section's only child. That is the one arrangement where a filled header cell can meet all four corners, so it is the only one that clips. Everywhere else a dropdown or tooltip opened inside a cell stays free to escape.
A summary strip
Three cells in a three-column grid, so the row stays on one line. This is the grid as the section's only content, which is when it also picks up the section's rounded corners.
Cell content is yours — the grid supplies the columns, the rules and the cell padding, nothing else. text-small, text-muted, text-bold and text-larger above are ordinary typography utilities, not part of the section-grid API.
Under a heading
The grid still reaches the section's left and right edges, but keeps the space between itself and the heading above it.
Narrow first column
.section-grid-aside gives a summary column beside detail rows. The fixed ratios do the same at a set split.
Responsive
Column counts take a breakpoint, and chain with a base count so the grid reflows. Two columns here, four from md up — narrow the preview to see it fold.
Related
- Panel grid — the benefits-theme equivalent. Same modifier vocabulary, so markup ports across; it sits inside a
.panelrather than a bordered section. - Employee chips — for labeling a value inside a cell.
- Bordered section — the container this grid goes in. The class exists in both themes; that page demos the benefits one.