Foundations
Breakpoints
The screen widths where the layout changes. Three breakpoints, designed mobile first.
Why we chose this
Fewer breakpoints mean fewer layouts to design, build and test. Three cover phones, tablets and laptops (768, 1024 and 1280px). The base styles are the phone layout and rules are added as the screen grows, so the smallest screens stay simplest.
Use it for
- Write the phone layout first, then add
@media (min-width: …) - Grid columns: 4 on mobile, 8 on tablet, 12 on desktop
- Change the layout where the content breaks, using these three values only
Don't
- Add a one-off like
min-width: 900px. - Target devices ("iPhone", "iPad").
- Write desktop first and undo it with
max-width.
The breakpoints
Grid and gutters
Columns and gutters change at the breakpoints. Drag to see how a layout reacts.
What changes where
| Screen | Range | Columns | Side gutter | Content |
|---|---|---|---|---|
| Mobile | below 768px | Full width | ||
| Tablet | 768px to 1023px | Full width | ||
| Desktop | 1024px to 1279px | Full width | ||
| Wide | 1280px and up | Centered, max |
Type scales smoothly between phone and desktop with no breakpoint (see Typography). Spacing tokens stay fixed, and you choose smaller steps on mobile (see Spacing).
Using them
CSS media queries can't read variables, so write the number and keep it equal to the token.
.layout { display: grid; gap: var(--space-4); grid-template-columns: repeat(4, 1fr); }
@media (min-width: 768px) { .layout { grid-template-columns: repeat(8, 1fr); gap: var(--space-6); } }
@media (min-width: 1024px) { .layout { grid-template-columns: repeat(12, 1fr); } }
// Tailwind (the preset adds these screens)
<div class="grid grid-cols-4 tablet:grid-cols-8 desktop:grid-cols-12">
// JavaScript
const isTablet = matchMedia("(min-width: 768px)").matches;
Rules
| Rule | Reason |
|---|---|
Write mobile styles first, then add with min-width. | Simpler and lighter on phones. |
Use only these three breakpoints. Don't add a one-off like @media (min-width: 900px). | Every extra width is another layout to test. |
| Don't target devices ("iPhone", "iPad"). Change the layout when the content breaks. | Device sizes change every year. |
| No horizontal scrolling at 320px. | The smallest supported width. |
| Test at 320, 375, 768, 1024, 1280 and 1440px, and at 200% zoom. | Edge of each range plus the extremes. |
Base styles for phone, then @media (min-width: 768px).
.grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
}
@media (min-width: 768px) {
.grid { grid-template-columns: repeat(8, 1fr); }
}
@media (min-width: 1024px) {
.grid { grid-template-columns: repeat(12, 1fr); }
}Desktop styles first, then max-width overrides to undo them.
.grid {
display: grid;
grid-template-columns: repeat(12, 1fr);
}
@media (max-width: 900px) {
.grid { grid-template-columns: repeat(4, 1fr); }
}