Spacing
One 8-point grid for every gap, margin and padding, with three fixed tiers for panels.
Rules
8-point grid. Every margin, padding, gap, and fixed size must be a multiple of 8pt/px. 4pt/px is the only allowed exception, for micro-adjustments between tightly-coupled elements only.
| Token | Value | Tailwind | iOS (AppTheme.Spacing) | Android (Dimens) | Use |
|---|---|---|---|---|---|
space-1 | 4pt/px | p-1, gap-1 | xs (4pt) | spacing_xs | Micro-adjustment between coupled items |
space-2 | 8pt/px | p-2, gap-2 | sm (8pt) | spacing_sm | Items within a tight group |
space-4 | 16pt/px | p-4, gap-4 | md (16pt) | spacing_md | Standard gutter, card padding |
space-6 | 24pt/px | p-6, gap-6 | lg (24pt) | spacing_lg | Between groups, section gaps |
space-8 | 32pt/px | p-8, gap-8 | xl (32pt) | spacing_xl | Major section separation |
space-10 | 40pt/px | p-10, gap-10 | xxl (40pt) | spacing_xxl | Hero padding |
space-12 | 48pt/px | p-12, gap-12 | xxxl (48pt) | spacing_xxxl | Maximum section breathing room |
target-min | 44px web, 44pt iOS, 48dp Android | --target-min; btn-target-fixed holds an icon button at it under a container variant | 44pt (not yet a named constant) | 48dp (not yet a named constant) | The touch-target floor and its one canonical name. px, not rem: a target is a pointer measure and does not grow with text (WCAG 2.5.8 asks 24px). --size-game-bar (2.75rem) is a game bar's height that equals the floor at the default size, not a second name for it |
size-bar-control | 48px web | --size-bar-control; nav-circle, btn-bar, the screen header's spacers and pills | (not yet a named constant) | (not yet a named constant) | A screen-header control's width and height. px on purpose, like the touch floor above it: the bar's geometry holds while text grows, so its controls never push the title off a 320 screen (B308). Clears target-min |
Standard gutters:
- Page horizontal padding:
16pt/px(space-4,px-safe/md). Web token--container-inner-px: 1rem; every deploy of www (every exported page) and hub checks it at 320 and 375 withcheck-rendered-gutter. - Card internal padding:
16pt/px(space-4) - List item vertical padding:
8–12pt/px(space-2tospace-3) - Nav item vertical padding:
8pt/px(space-2) - Section gap:
24pt/px(space-6)
Section panel padding: two canonical tiers (web; do NOT hand-roll per section):
A content section in a widget-panel / card-panel uses exactly one of three padding utilities. widget-panel itself carries NO padding, so the tier is always explicit. This replaced the prior drift (p-4 / p-5 / p-6 / pt-5 pb-4 px-4 all coexisting).
| Tier | Utility | Value | Use |
|---|---|---|---|
| XS (tight strip) | section-pad-xs | p-3 (12pt) | Strip widgets whose own cards carry the weight; chrome must not waste space, as in the finance index strip. Near the briefing player's tightness. |
| SM (compact) | section-pad-sm | px-4 pt-3 pb-4 (16 / top 12 / bottom 16) | Compact widgets: weather, profile completion. |
| LG (content) | section-pad-lg | px-4 pt-3 pb-4 md:px-6 md:pt-4 md:pb-6 (sides 16→24, top 12→16, bottom 16→24) | Content sections: mate, hub, news, lens, charts. |
The top inset is one step under the sides. A section title sits in a row as tall as its 44pt controls, so that row already puts space above the words; a full inset on top of it doubled the gap. The words still sit about 20pt or more from the card's edge, so a header never touches it.
A tight strip section (XS) pairs with HorizontalCardRail bleed="xs" so the cards still reach the panel edge despite the small padding. Special chrome opts out of all three: the top briefing player and the prompt input (bespoke player/input shells), and naked panel-less sections like the series rail (w-full space-y-3, no panel to pad).
Anti-patterns:
- A
widget-panel/card-panelcontent section with hand-rolledp-4/p-5/p-6/pt-* pb-* px-*instead ofsection-pad-sm/section-pad-lg: prohibited. .padding(14),px-5,gap-5: not on the grid, prohibitedspacing: 10in SwiftUI VStack: use4(xs) or8(sm)- Arbitrary Tailwind values like
px-[18px]: extract tospace-4orspace-6
Live specimens
space-14pxspace-28pxspace-416pxspace-624pxspace-832pxspace-1040pxspace-1248px