Skip to main content

  • Foundations
    • Border radius
    • Breakpoints
    • Colours
    • Colour scheme
    • Elevation
    • Focus and outline
    • Sizing and spacing
    • Layout
    • Motion
    • Typography
    • Z-index
  • Elements
    • Buttons
    • Code
    • Icons
    • Figure and caption
    • Forms
    • Links
    • Lists
    • Media
    • Tables
  • Components
    • Accordion
    • Alerts
    • Avatar
    • Blockquote
    • Breadcrumbs
    • Card
    • Chiplets
    • Details and summary
    • Dialog
    • Empty state
    • Stats
    • Global footer
    • Horizontal rule
    • Kanban
    • Key-value list
    • Meter
    • Objects
    • Pagination
    • Polka background
    • Post-it note
    • Progress
    • Speech bubbles
    • Status dot
    • Skeleton
    • Skip link
    • Spinner
    • Toggles
    • Tooltip
    • Webmentions
  • Patterns
    • Article header
    • Author card
    • App list and app sheet
    • Error page
    • Related posts
    • Search results
    • Utilities

John Peart

  • Search
  • Menu
John Peart

Sizing & spacing

The pad scale, borders, radii, outlines and shadows.

All spacing is derived from a single base unit, --pad (15px), and a small set of element-level tokens.

Base unit — pad

All paddings, margins and gaps are multiples of --pad.

0.5× 7.5px
1× 15px
2× 30px
3× 45px
4× 60px
8× 120px
padding: var(--pad);
margin: calc(var(--pad) * 2);
gap: calc(var(--pad) * 0.5);

Element sizes

Touch target --touch-target-size — 44px
Input --input-size — 40px
Radio --radios-size — 40px

Borders

Border width --border-width — 3px
Focus border width --border-focus-width — 1px

Border radius

Multiples of --border-radius (12.5px).

1× var(--border-radius)
2× calc(var(--border-radius) * 2)

Outlines

Default offset --outline-offset — 3px
Focus offset --outline-focus-offset — 0px
Active offset --outline-active-offset — 3px

Shadows

Shallow Deep
box-shadow: var(--shadow-shallow); /* 0px 3px 0px var(--color) */
box-shadow: var(--shadow-deep);    /* 0px 5px 0px var(--color) */

Input padding

padding: var(--input-padding); /* 10px 15px */
A line drawing of John Peart

John Peart

www.johnpe.art

Mastodon logo

Mastodon

BlueSky logo

Bluesky

LinkedIn logo

LinkedIn

Github logo

GitHub