Spacing System

The Alterspective spacing system uses a consistent scale based on 4px increments. This ensures visual harmony and predictable layouts across all implementations.

Spacing Scale

Use these spacing values for margins, padding, and gaps.

space-1 4px

Tight spacing, icon padding

space-2 8px

Compact elements, inline spacing

space-3 12px

Small gaps, form element padding

space-4 16px

Standard padding, card content

space-5 20px

Medium gaps

space-6 24px

Section padding, card gaps

space-8 32px

Large section spacing

space-10 40px

Major section breaks

space-12 48px

Page section margins

space-16 64px

Hero section padding

space-20 80px

Major page divisions

space-24 96px

Maximum spacing

Border Radius

Consistent corner rounding for UI elements.

radius-none 0px

Sharp corners, tables

radius-xs 4px

Buttons, tags, badges

radius-sm 8px

Cards, inputs, small containers

radius-md 12px

Modals, larger cards

radius-lg 16px

Hero sections, feature cards

radius-xl 28px

Pill shapes, large features

radius-full 9999px

Circles, fully rounded

Usage Examples

Card Component

Card Title

Card content with proper spacing.

.card {
  padding: var(--as-space-4);    /* 16px */
  border-radius: var(--as-radius-sm); /* 8px */
  gap: var(--as-space-3);        /* 12px */
}

Button Component

.button {
  padding: var(--as-space-3) var(--as-space-4);
  border-radius: var(--as-radius-xs); /* 4px */
}

Section Layout

Section
Section
.section {
  padding: var(--as-space-8);     /* 32px */
  margin-bottom: var(--as-space-12); /* 48px */
}

CSS Variables

Use these CSS custom properties in your stylesheets:

:root {
  /* Spacing Scale */
  --as-space-1: 4px;
  --as-space-2: 8px;
  --as-space-3: 12px;
  --as-space-4: 16px;
  --as-space-5: 20px;
  --as-space-6: 24px;
  --as-space-8: 32px;
  --as-space-10: 40px;
  --as-space-12: 48px;
  --as-space-16: 64px;
  --as-space-20: 80px;
  --as-space-24: 96px;

  /* Border Radius */
  --as-radius-none: 0px;
  --as-radius-xs: 4px;
  --as-radius-sm: 8px;
  --as-radius-md: 12px;
  --as-radius-lg: 16px;
  --as-radius-xl: 28px;
  --as-radius-full: 9999px;
}
Style
Theme