Foundations

The px laws

Sixteen rules that keep every screen from looking broken. Seven of them a machine can test — the checker in the corner runs them on any page, any theme, any width.

Test this page now

Runs every machine-checkable law on this page at its current width and theme. Resize the window or switch theme and run it again.

On a phone: 9 more laws ↓

All 23 laws

  1. 01
    The page never scrolls sideways

    At any width from 320 to 2560px, nothing pushes past the edge of the screen.

    Checked automatically
  2. 02
    Text never gets cut off

    One-line labels end in “…”; longer text wraps; numbers and buttons never wrap.

    Checked automatically
  3. 03
    Smallest text is 11px

    10px is allowed only for chart axis labels. Body text is 14px.

    Checked automatically
  4. 04
    Everything you can press is big enough

    Visible controls are at least 32×32px (38px standard). On touch screens every control also gets an invisible 44×44px tap area, so it stays easy to hit without looking bigger.

    Checked automatically
  5. 05
    Every control says what it does

    Icon-only buttons have a label; images have alt text; fields have a label.

    Checked automatically
  6. 06
    Text is readable

    4.5:1 contrast for content text. 3:1 for large numbers (24px and up) and for secondary labels in the muted grey — the Octagon OS look, a deliberate trade below WCAG AA for small grey labels.

    Checked automatically
  7. 07
    Corners come from the scale

    6 · 9 · 10 · 12 · 13 · 14 · 16 · 22 · 26 · oval (99px). Inside corner = outside corner − the gap between them (a 26px card with 12px padding holds 14px corners).

    Checked automatically
  8. 08
    Space has a rhythm

    Cards sit 16px apart (12px on phones). Card padding 24–26px (20px on phones). Page gutter 24px (8px on phones).

    Checked in review
  9. 09
    One line weight

    Borders and separators are 1px. Separators use the line colour, never a darker grey.

    Checked in review
  10. 10
    Things stack in one order

    Page → raised cards → sticky headers → sidebar → menus → dialogs → notifications. Only the layer tokens are used.

    Checked in review
  11. 11
    Numbers line up

    Tabular figures everywhere; € with cents in totals; big figures carry a small € at 0.42em; a number never wraps.

    Checked in review
  12. 12
    One icon family

    12–24px, 1.6 stroke, round ends, centred in a square hit area. No mixed icon sets.

    Checked in review
  13. 13
    One mark per list row

    Every row in a list card starts with the same 36px tile (10px corners, 18px icon) naming what the row is about. Grey by default; a row carries one colour signal at most — the tile when it asks you to act, otherwise its status chip. Breakdown rows under a figure carry no tile.

    Checked in review
  14. 14
    Motion never moves the layout

    Animate transform and opacity only. Hover changes colour, never position: buttons never lift.

    Checked in review
  15. 15
    Every press answers where you pressed

    A pressed control sinks a little. The result shows in the same place — a row turns done and offers Undo — and the other rows slide, never jump. A message pops up only when the result is somewhere else.

    Checked in review
  16. 16
    Every data block has four states

    Loading, empty, error and filled — designed, not left blank.

    Checked in review
  17. 17
    Same meaning, same colour

    Blue = active or due · orange = planning · green = done or paid · red = overdue. Never decoration.

    Checked in review
  18. 18
    One thing is loudest

    Each screen has one hero — the biggest figure or the one dark card. Everything else steps down; two cards never shout at the same size.

    Checked in review
  19. 19
    Three levels, no more

    Big figure → short label → detail. Size and weight make the order; colour does not.

    Checked in review
  20. 20
    The answer comes first

    A card opens with its answer in one line (“14 of 18 at work”), and its rows only explain it.

    Checked in review
  21. 21
    Each card has its own shape

    People show as faces, money as a figure, to-dos as rows with their one button. Two cards side by side never look like the same list.

    Checked in review
  22. 22
    Calm by default

    About 60% plain surface, 30% grey text, 10% colour — and that 10% only on what you must look at or press. No boxes inside boxes.

    Checked in review
  23. 23
    Reading stays comfortable

    Panels stop at 1360px; reading text stops at 72 characters per line.

    Checked in review

On a phone: 9 more

  1. P1
    Thumb first

    The main places live in the bottom bar. A card’s main action sits at its foot, full width, at least 44px tall.

    Checked in review
  2. P2
    Fields never zoom the page

    Inputs, text boxes and selects use 16px text on a phone, so the phone never zooms in when you tap one.

    Checked automatically
  3. P3
    Few words

    One line says what it is; one button says what to do. No second lines, no labels for what you can already see.

    Checked in review
  4. P4
    Only what is needed

    A list shows up to four rows, then “See all”. Breakdowns and secondary figures fold away behind one tap.

    Checked in review
  5. P5
    Menus rise from the bottom

    Menus and pickers open as a sheet at the bottom of the screen, rows 48px tall, closed by a tap outside.

    Checked in review
  6. P6
    Nothing hides under the edges

    Nothing sits under the bottom bar, the notch or the home bar; the page ends above the bar.

    Checked in review
  7. P7
    One column

    The page never scrolls sideways. Only chip rows slide, starting at the page edge.

    Checked in review
  8. P8
    The first screen answers

    Without scrolling: what is happening and what to do next.

    Checked in review
  9. P9
    Motion is quick

    Phone transitions stay at 300ms or less, and a swipe follows the finger.

    Checked in review