Skip to content

Z-index

Z-index tokens define stacking order so overlays and chrome appear in a predictable order.

Scale

TokenValueUse
--sp-layer-base0Default document flow
--sp-layer-raised10Sticky nav, raised panels
--sp-layer-dropdown100Dropdowns, popovers
--sp-layer-modal200Modals, dialogs
--sp-layer-toast300Toasts
--sp-layer-tooltip400Tooltips

Usage

css
.my-overlay {
  z-index: var(--sp-layer-modal);
}

Use the layer that matches the component type so modals stay above dropdowns and toasts above modals when needed.

Overlays use --sp-layer-* tokens so stacking order is predictable.

MIT License · Lightweight by principle. Sustainable by design.