Spacing and shape

Comb is built on a 4px grid. Space, corners and shadows come in a few fixed steps, each named for where it goes. Values in these tables are read from the live tokens.

Spacing

Every margin, padding and gap is a space token. Small steps sit inside controls, middle steps between items, large steps between parts of a page.

Spacing tokens
ExampleTokenValueUsage
Space 1--space-1ReadingIcon to text.
Space 2--space-2ReadingInside compact controls; between a button pair.
Space 3--space-3ReadingRow padding and field gaps.
Space 4--space-4ReadingButton padding and small plates.
Space 5--space-5ReadingPlate padding and space below a field.
Space 6--space-6ReadingThe page gutter; sections in a side panel.
Space 8--space-8ReadingBetween groups on a page.
Space 10--space-10ReadingBetween page sections.
Space 12--space-12ReadingSection block padding.
Space 16--space-16ReadingMajor separators.
Space 20--space-20ReadingTop-level page padding.

Radius

A corner says what kind of thing a shape is. These role tokens are in place; console call sites still use the older 8, 12 and 16px radii and move over in a later step.

Radius tokens
ExampleTokenValueUsage
Radius XS--comb-radius-xsReadingBadges and checkboxes.
Radius S--comb-radius-smReadingLozenges, tags and tooltips.
Radius M--comb-radius-mdReadingButtons, inputs and nav items.
Radius L--comb-radius-lgReadingCards, menus and popovers.
Radius XL--comb-radius-xlReadingModals, panels and tables.
Radius full--comb-radius-fullReadingAvatars and pills.

Elevation

Four surfaces, each paired with its shadow. Shadows are warm umber, never neutral grey, and they mark state rather than decorate.

Shadow tokens
ExampleTokenValueUsage
Raised--shadow-smReadingCards and the queue list plate at rest; the primary button.
Hover--shadow-mdReadingA raised plate or primary button under the pointer.
Overlay--shadow-lgReadingMenus, the command palette and dialogs.
Modal--shadow-xlReadingFull overlays on the public site.
Sunkenkb-plate--sunkenDesk rail and board columns. No shadow.
Defaultkb-plateA plate on the ground with a warm hairline.
Raisedkb-plate--raisedThe queue list and cards. One focal point per view.
Overlaykb-plate--overlayMenus, the command palette and dialogs.

Focus ring

One ring for every control: 2px of gold, drawn 2px outside the element so it never covers the label, following the control's corners. It shows for keyboard focus, not a mouse click.

.kb-btn:focus-visible {
  outline: 2px solid var(--comb-focus-color);
  outline-offset: 2px;
}

Using spacing and shape

  • Pick a space token by band: 4 to 8px inside a control, 12 to 24px between items, 32 to 80px between parts of a page.
  • Keep nested plates concentric: the inner radius is the outer radius minus the padding between them. A 16px tray with 4px padding holds a 12px core.
  • Never put a plate inside a plate. Use a hairline or space to divide a plate instead.
  • Use a shadow to show state: plates rest on the raised shadow and lift to hover. A flat card is a plate with a hairline.
  • Never remove the focus ring without drawing a replacement.

Do and don't

DoSpace a button pair with a token, here space 2 (8px).
Don'tNudge by eye to 13px. Off-grid gaps are counted by the Comb lint run.
AssigneeYouTeamBilling
DoDivide one plate with a hairline.
You
Billing
Don'tNest plates. The shadows stack and the hierarchy blurs.