Skip to content

SCSS: Z-index

The z-index scale avoids magic numbers for common layers.

TokenValueExpected use
$z-base0Normal layer
$z-raised1Local raised elements
$z-sticky10Sticky elements
$z-header100Fixed navigation
$z-overlay1000Backdrops and overlays
$z-modal1100Modals and drawers
$z-toast1200Temporary messages
$z-base · 0base content
$z-raised · 1raised content
$z-header · 100header/sticky
$z-overlay · 1000overlay
$z-modal · 1100modal/drawer
$z-toast · 1200toast

Do not use z-index tokens to hide stacking bugs without checking position, transform and overflow.