Skip to content

Spacing and sizing

A 4px spacing scale, a handful of control heights and icon sizes, and two line weights. Use the tokens and every gap on a page agrees.

CSS
css/tokens.css

01 — Spacing

The scale

A 4px base. Gaps inside a component use 1 to 4, gaps between components 5 to 7, and gaps between sections 8 to 10.

--space-1
--space-2
--space-3
--space-4
--space-5
--space-6
--space-7
--space-8
--space-9
--space-10

Stack and cluster

Spacing between elements comes from the parent, never from margins on the children. .stack spaces a column; .cluster spaces a row that wraps. Set the gap with --stack-gap or --cluster-gap.

.stack · --space-3

First paragraph.

Second paragraph.

.cluster · --space-2

IdentityEditorialMotion

02 — Control heights

Heights

Controls share five heights. On touch screens, buttons, tabs and menu items grow to 44px, and every control keeps a tap area of at least --hit-min.

--control-h-xs
--control-h-sm
--control-h
--control-h-touch
--control-h-lg
--hit-min

03 — Icon sizes

Icons

Icons are hairline outlines (--icon-stroke, 1.25) in the text color. 16px inside buttons and fields, 22px in the header and the floating button, 28px in drop zones and empty states.

--icon-xs
--icon-sm
--icon-md
--icon-lg

04 — Radius

Corners

Mostly square. Pills are for tags, badges and the round search. Content panels have their own shape: see Panels and surfaces.

--radius-0
--radius-1
--radius-2
--radius-3
--radius-pill
--radius-round

05 — Rules

Lines

A 1px hairline for edges and dividers. A 2px rule marks what’s selected or current: the open tab, the current page, a notice’s tone, a focused field.

--hairline
--rule-strong

06 — Density

Compact

Jewel’s spacing is editorial. For dashboards and dense tools, data-density="compact" on <html>, a region or one panel steps down panel padding, form gaps, buttons and table rows together. Touch screens keep 44px targets.

prod-east

Pods
18
Nodes
3
PodStateCPU
api-7f9cRunning120m
worker-5b8dPending340m
web-66c9Running80m

prod-east

Pods
18
Nodes
3
PodStateCPU
api-7f9cRunning120m
worker-5b8dPending340m
web-66c9Running80m
<html lang="en" data-theme="dark" data-density="compact">

What changes

TokenDefaultCompact
--panel-padding24–48px16px
--panel-stack-gap16px12px
--density-gap24px12px
--control-h40px32px
--control-h-touch44px36px with a mouse, 44px on touch
Table rows44px32px, like .table--compact

07 — Usage

Use it for

  • The spacing tokens for every margin, padding and gap.
  • .stack and .cluster to space groups of elements.
  • --control-h* for anything a person presses, and --hit-min for its tap area.

Avoid

  • Pixel values, or numbers between the steps of the scale.
  • Margins on elements inside a .stack. The stack sets the gap.
  • Controls shorter than 44px on touch screens.

08 — Tokens

Tokens
TokenValueWhat it’s for
--space-1Hairline gaps
--space-2Icon to label
--space-3Tight groups
--space-4Default gap
--space-5Between components
--space-6Between blocks
--space-7Between groups
--space-8Between sections
--space-9Large sections
--space-10Page breaks
--control-h-xsTags, chips
--control-h-smTouch tags, compact controls
--control-hButtons, tabs, menu items
--control-h-touchFields, and every control on touch screens
--control-h-lgFloating button, chat composer
--density-gapBetween fields in a form
--hit-minMinimum tap area
--icon-xsSpinners, chevrons
--icon-smIcons in buttons and fields
--icon-mdHeader, floating button
--icon-lgDrop zone, empty states
--icon-strokeIcon line weight
--radius-0Most things
--radius-1Small details
--radius-2Chips
--radius-3Larger cards
--radius-pillTags, badges
--radius-roundDots, avatars
--hairlineEdges and dividers
--rule-strongSelected and current