Skip to main content
FEASIBILITY REVIEW

Spacing

A base-4px spacing scale with named tokens for every spacing decision. Consistent spacing creates rhythm, reduces cognitive load, and makes components feel related.

The Orbit spacing scale is built on a base of 4px. Every token is a multiple of 4, which means components designed to these values automatically align to a 4px grid. This makes spacing decisions predictable — when you pick a token, you're choosing a position on a shared scale rather than an arbitrary pixel value.

Semantic spacing tokens

Semantic spacing tokens map a primitive scale step to an intended role — component-level padding and gaps, or page-level layout rhythm. Use these over primitive tokens directly wherever a component or layout role applies; they carry intent and stay in sync if the underlying scale step changes.

TokenResolves to
Component
--orbit-spacing-component-padding-block-2xs spacing.space-4 4px
--orbit-spacing-component-padding-block-xs spacing.space-8 8px
--orbit-spacing-component-padding-block-s spacing.space-10 10px
--orbit-spacing-component-padding-block-m spacing.space-12 12px
--orbit-spacing-component-padding-inline-2xs spacing.space-4 4px
--orbit-spacing-component-padding-inline-xs spacing.space-8 8px
--orbit-spacing-component-padding-inline-s spacing.space-12 12px
--orbit-spacing-component-padding-inline-m spacing.space-14 14px
--orbit-spacing-component-padding-inline-lg spacing.space-16 16px
--orbit-spacing-component-padding-inline-xl spacing.space-20 20px
--orbit-spacing-component-padding-gap-2xs spacing.space-4 4px
--orbit-spacing-component-padding-gap-xs spacing.space-8 8px
--orbit-spacing-component-padding-gap-s spacing.space-12 12px
--orbit-spacing-component-padding-gap-m spacing.space-16 16px
Layout
--orbit-spacing-layout-content-gap spacing.space-24 24px
--orbit-spacing-layout-section-gap spacing.space-48 48px
--orbit-spacing-layout-page-gutter spacing.space-32 32px
--orbit-spacing-layout-stack-sm spacing.space-16 16px
--orbit-spacing-layout-stack-md spacing.space-24 24px
--orbit-spacing-layout-stack-lg spacing.space-40 40px

Token Reference

Token names follow the pattern --op-space-[step], where the step number corresponds to the rem value × 4. For example, --op-space-16 is 1rem (16px), and --op-space-32 is 2rem (32px). Note that the scale skips steps 7, 9, 11, and others — only the steps with established usage in the system are included.

--op-space-4 Micro gap
0.25rem 4px
Icon/label gap, inline badge padding, tight list gaps
--op-space-8 Tight gap
0.5rem 8px
Gap between an icon and its label, tag internal padding, stacked chip rows
--op-space-12 Small padding
0.75rem 12px
Button vertical padding (small), input internal padding, compact list items
--op-space-16 Base unit
1rem 16px
Default horizontal button padding, form field gap, nav item padding
--op-space-20 Comfortable padding
1.25rem 20px
Horizontal button padding (medium), dropdown item padding, sidebar padding
--op-space-24 Card padding
1.5rem 24px
Card and panel internal padding, modal content padding, section intro gap
--op-space-32 Section gap
2rem 32px
Space between sections within a page, between cards in a grid
--op-space-40 Large section gap
2.5rem 40px
Space between major page sections, top padding on main content area
--op-space-48 Page section separation
3rem 48px
Separation between distinct content areas, between hero and body content
--op-space-64 Hero padding
4rem 64px
Vertical padding on hero sections, generous layout breathing room
--op-space-80 Large hero padding
5rem 80px
Large breakpoint hero sections, splash-page vertical rhythm
--op-space-96 Extra-large rhythm
6rem 96px
Maximum vertical padding on marketing or landing content
--op-space-128 Maximum spacing
8rem 128px
Extreme vertical separation, full-bleed section margins at wide breakpoints

Usage guidelines

Match the token to the relationship

Spacing communicates the relationship between elements — close elements feel related, distant elements feel separate. Use smaller tokens for elements within the same component (space-1 through space-4) and larger tokens for gaps between components or sections (space-6 and above).

Use tokens, not raw values

Never use a raw pixel or rem value in component styles. Even if the value happens to match a token — write var(--op-space-16), not 16px. Raw values break the grid when the scale is updated, and they're invisible to tooling that audits token usage.

Vertical vs horizontal spacing

Vertical spacing (between sections, stacked cards, form fields) typically uses larger values than horizontal spacing within the same context. A form where fields have 24px vertical gaps (space-6) and 16px horizontal padding (space-4) feels right. Reversing those values makes the layout feel compressed.

Consistent padding within a component

Use the same token for the horizontal and vertical padding of a component wherever possible. If a card uses --op-space-24 on all sides, it feels balanced. If it uses different values on each side without a clear reason, it reads as a mistake rather than a deliberate design decision.

Do

Use adjacent scale steps for related elements. A gap of space-2 between an icon and its label, and space-4 between the label and the next item, creates clear visual hierarchy.

Don't

Skip multiple scale steps within the same component. A component with space-1 padding and space-12 internal gap is not following the rhythm — it looks like a mistake.

Do

Use space-8 or larger to separate distinct page sections. This creates a clear visual boundary without needing a divider line.

Don't

Use the same spacing value for both component-internal padding and section-level separation. Reserve the large tokens (space-10+) for layout-level gaps only.

Touch targets

Every interactive element must have a minimum touch target of 44×44px, following WCAG 2.5.5 (AAA) and Apple and Google platform guidelines. This applies to buttons, links, checkboxes, radio buttons, switches, and all other interactive controls.

When a component's visible size is smaller than 44px, add invisible padding or use an absolutely-positioned overlay to extend the tap area without changing the visual layout. Never reduce the touch target to match a small visual design — adjust the visual design or add the invisible zone.

Component Visible size Touch target Approach
Button (medium) 40px height 44×44px Add 2px invisible vertical extension
Button (small) 32px height 44×44px Add 6px invisible vertical extension
Checkbox / Radio 16–20px 44×44px Extend target to the label; label is part of the touch area
Icon button 24–32px 44×44px Add invisible padding via min-width/min-height: 44px
Link (inline text) Line height 44px height preferred Increase line height or use block-level link where possible

On Social Point community-facing surfaces — where users include people with motor impairments, older devices, and touch-only navigation — treat 44×44px as a strict minimum and aim for 48×48px where the layout allows.

Was this page helpful?