Spectra v0.1

Fundamentals / spacing

Priority 1

Spacing

Back to docs

The spacing scale is a 4px rhythm. Use it for gaps, padding, layout breathing room, and shell spacing before reaching for custom values.

Spacing scale

PreviewTokenUsed forValue
--sp-0Reset / none0px
--sp-1Tight nudges4px
--sp-2Dense controls8px
--sp-3Default compact gaps12px
--sp-4Base padding16px
--sp-5Roomy control groups20px
--sp-6Section rhythm24px
--sp-7Large stack spacing28px
--sp-8Panel / hero gaps32px
--sp-9Bridge between 32 and 4036px
--sp-10Large section spacing40px

Usage guidance

Inside components

Use --sp-2 to --sp-4 for controls, badges, nav links, and dense rows.

Between sections

Use --sp-6 to --sp-10 for card groups, page sections, heroes, and footer breathing room.

.sp-card__body {
  padding: var(--sp-4);
}

.sp-header__inner {
  gap: var(--sp-4);
  padding-block: var(--sp-3);
}