Layout
Two containers and one flex helper. Everything else is native CSS.
Container
.container centers content and steps its max width at each breakpoint.
.container-fluid keeps the padding but spans the full width, which is what you want
for a full-bleed section.
The widths and the side room are tokens: --page-max (the content column) and
--page-pad (the least room at the sides, 1rem on phones). .navbar-flush runs
edge to edge but lines its contents up with them, so a full-width header's title sits over the
content's left edge and its last button over the right edge. An app with its own column sets the two
tokens once and the header follows.
| Viewport | .container max width |
|---|---|
| < 576px | 100%, 1rem padding |
| ≥ 576px | 510px |
| ≥ 768px | 700px |
| ≥ 1024px | 950px |
| ≥ 1280px | 1200px |
| ≥ 1536px | 1450px |
A bare .container also caps at 80ch and adds bottom padding, which is
the reading measure this documentation uses.
<header class="container-fluid">…</header>
<main class="container">…</main>
Flex
.flex is display: flex with a 1rem gap. That is the whole
utility.
<div class="flex">
<article class="card-border" style="flex: 1">One</article>
<article class="card-border" style="flex: 1">Two</article>
<article class="card-border" style="flex: 1">Three</article>
</div>
Flip
Add .flip and the row becomes a column below 600px. Add .reverse and it
stacks bottom-up, which is how you get a sidebar that appears above the content on mobile but
beside it on desktop.
<div class="flex flip">
<article class="card-border" style="flex: 2">Main content</article>
<article class="card-border" style="flex: 1">Sidebar</article>
</div>
<div class="flex flip reverse">
<article class="card-border" style="flex: 2">Main, second on mobile</article>
<article class="card-border" style="flex: 1">Sidebar, first on mobile</article>
</div>
Resize the window to see the breakpoint.
Grid
There is no grid utility. Use CSS, and use the framework's variables for spacing so it stays in rhythm.
<div
style="
display: grid;
grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
gap: var(--padding);
">
<article class="card-border">Auto</article>
<article class="card-border">Fitting</article>
<article class="card-border">Grid</article>
<article class="card-border">Cells</article>
</div>
Spacing
--padding is the base unit. Block elements carry a 1rem bottom margin;
list items carry 0.25rem.
.tight {
--padding: 0.5rem;
}
.roomy {
--padding: 2rem;
}