Browse docs

Spacing, radius, and motion

Open full example →
On this page
  1. Spacing
  2. Radius
  3. Motion
  4. Easing
  5. Stacking order
  6. Control geometry
  7. Density presets
  8. Shadows
  9. Registered properties

Values below are generated from 02-tokens.css. Density overrides are read from 03-themes.css. Use layout gaps and component properties to apply these values without adding extra margins to every child.

Spacing

Spacing uses rem so it follows the reader’s font-size preference. Standard cards use --pl-space-5 for their inset; app-surface variants use a tighter inset. Use --pl-space-4 for common layout gaps.

Spacing scale
TokenDefault value
--pl-space-10.25rem
--pl-space-20.5rem
--pl-space-30.75rem
--pl-space-41rem
--pl-space-51.25rem
--pl-space-61.5rem
--pl-space-82rem
--pl-space-102.5rem
--pl-space-123rem

Radius

--pl-radius-control sets the default corner radius for interactive controls. Use the pill radius for fully rounded controls and avatars.

Corner radii
TokenDefault value
--pl-radius-xs0.25rem
--pl-radius-sm0.375rem
--pl-radius-md0.5rem
--pl-radius-lg0.75rem
--pl-radius-xl1rem
--pl-radius-2xl1.5rem
--pl-radius-pill999rem
--pl-radius-controlvar(--pl-radius-md)

Motion

Durations multiply by --pl-motion-scale. Reduced-motion preferences set that scale to zero.

Motion durations
TokenDefault value
--pl-duration-1calc(120ms * var(--pl-motion-scale))
--pl-duration-2calc(180ms * var(--pl-motion-scale))
--pl-duration-3calc(260ms * var(--pl-motion-scale))
--pl-duration-entercalc(220ms * var(--pl-motion-scale))
--pl-duration-exitcalc(160ms * var(--pl-motion-scale))

Easing

Easing curves
TokenDefault value
--pl-ease-standardcubic-bezier(0.2, 0, 0, 1)
--pl-ease-springcubic-bezier(0.34, 1.56, 0.64, 1)
--pl-ease-deceleratecubic-bezier(0, 0, 0.2, 1)
--pl-ease-acceleratecubic-bezier(0.4, 0, 1, 1)

Stacking order

Use the overlay and toast levels for floating content. A native dialog or popover also participates in the browser’s top layer.

Stacking levels
TokenDefault value
--pl-z-base0
--pl-z-raised10
--pl-z-sticky100
--pl-z-fixed500
--pl-z-overlay1000
--pl-z-toast1100

Control geometry

These are the default dimensions before a density preset overrides them.

Control defaults
TokenDefault value
--pl-control-block-size2.5rem
--pl-control-padding-inlinevar(--pl-space-4)
--pl-control-gapvar(--pl-space-2)
--pl-control-border-width1px
--pl-control-radiusvar(--pl-radius-control)

Density presets

comfortable is the default. compact changes control geometry; dense also compresses spacing and small text. Set data-pl-density on the region that needs the change.

Control dimensions by density
DensityControl heightInline paddingGap
compact2remvar(--pl-space-3)var(--pl-space-1)
dense1.75remvar(--pl-space-2)var(--pl-space-1)
comfortable2.5remvar(--pl-space-4)var(--pl-space-2)
touch2.75remvar(--pl-space-5)var(--pl-space-2)

Shadows

Shadows can contain multiple layers. The full declaration is shown so values stay consistent with the rendered framework.

Shadow declarations
TokenDefault value
--pl-shadow-bevelinset 0 1px 0 light-dark(oklch(100% 0 0deg / 70%), oklch(100% 0 0deg / 8%))
--pl-shadow-insetinset 0 1px 2px oklch(0% 0 0deg / 8%)
--pl-shadow-10 1px 2px oklch(0% 0 0deg / 8%), 0 1px 4px oklch(30% 0.04 40deg / 6%), var(--pl-shadow-bevel)
--pl-shadow-20 4px 8px oklch(0% 0 0deg / 8%), 0 8px 24px oklch(25% 0.06 40deg / 12%), inset 0 1px 0 oklch(100% 0 0deg / 6%)
--pl-shadow-30 8px 16px oklch(0% 0 0deg / 10%), 0 24px 64px oklch(20% 0.08 40deg / 18%), inset 0 1px 0 oklch(100% 0 0deg / 8%)
--pl-shadow-40 12px 24px oklch(0% 0 0deg / 12%), 0 32px 80px oklch(20% 0.08 40deg / 24%), inset 0 1px 0 oklch(100% 0 0deg / 10%)
--pl-shadow-glow0 0 0 4px color-mix(in oklab, var(--pl-color-accent), transparent 72%)

Registered properties

Registered properties specify a type and an initial value. An initial value is the fallback for the registration, not necessarily the declaration used by the active theme.

Custom-property registrations
PropertySyntaxInitial valueInherits
--pl-motion-scale<number>1yes
--pl-radius-control<length>8pxyes
--pl-focus-size<length>2pxyes

Search Porchlight