People check an order on a phone and work through a day of syncs on a wide monitor. The layout changes at a few widths so each screen fits the window it is in.
The layout changes at three window widths: 768, 1024 and 1440 px. Every screen also works at 320 px.
- xs0–767
- md768–1023
- lg1024–1439
- xl1440+
xl has no upper end. Every screen must also work at 320 px.What changes
| Breakpoint | From | Windows | What changes |
|---|---|---|---|
xs |
0 | Phones and small windows | One fluid layout: 4 columns, gutter and page margin 16 px, content in one column. Side navigation in a drawer. |
md |
768 px | Tablets, narrow windows | 8 columns. Gutter and page margin 24 px. Side navigation still in a drawer. |
lg |
1024 px | Laptops, including 1280 and 1366 px screens | 12 columns. Side navigation open at 280 px, or collapsed to the 64 px rail. A side panel next to the main one. |
xl |
1440 px | Desktops, including 1536 and 1920 px screens | Page margin 32 px. Four cards a row. |
- Below 768 px is one layout. Its columns stretch with the window, from 320 to 767 px. A card or a table inside it can still change with the width of its own container, using container queries.
- 320 px is not a breakpoint. It is the narrowest window every screen must work in, which is also a 1280 px window zoomed to 400% (WCAG 1.4.10).
Design order
Design for desktop first, then fit the screen to smaller windows. Write the CSS from the smallest window up.
Beehexa products are used mostly on desktop, so their main screens start at the width people use most.
- Design at 1440 px, and check it at 1280 px.
- Fit it to 1024 px, then to 768 px.
- Fit it to 360 px, and check it at 320 px.
In code, the base styles are for the smallest window, and each breakpoint adds to them with min-width. Fewer rules have to be undone that way.
Check every screen at
| Window | Why |
|---|---|
| 1440 and 1280 px | The desktops and laptops people use most |
| 1024 px | Just above the point where the side navigation becomes a drawer |
| 768 px | Tablets, and the switch to 8 columns |
| About 844 × 390 px | A phone held sideways: wide enough for the tablet layout, but short |
| 360 and 320 px | Phones, and the narrowest window allowed |
| 400% zoom | People who enlarge the page |
Code
- Write media queries with
min-width:@media (min-width: 768px). - CSS custom properties cannot be used in media queries. Use the pixel values of these tokens.
- Change the layout at breakpoints, never the spacing tokens or text sizes inside a component.
Tokens
| Token | Value | Description |
|---|---|---|
--bh-breakpoint-xs | 0px | Phones and small windows, below 768 px. One fluid layout: 4 columns, gutter and margin 16 px, side navigation in a drawer. Must work down to 320 px. |
--bh-breakpoint-md | 768px | Tablets and narrow windows. 8 columns, gutter and margin 24 px. Side navigation still in a drawer. |
--bh-breakpoint-lg | 1024px | Laptops from 1024 px, including 1280 and 1366 px screens. 12 columns. Side navigation open at 280 px; people can collapse it to the 64 px rail. |
--bh-breakpoint-xl | 1440px | Desktops, including 1536 and 1920 px screens. Page margin 32 px. |