Home
Bookmarks
Leagues
LEARN
Courses
Career Paths
Assessments
Tutorials
Arcade
Glossary
GROW
Certifications
Log in
Glossary
Log inSign up
Courses/Introduction to Design Systems/Elevation, Z-Index & Spatial Depth/
Exercise #5

Tokenizing Z-Index: Ending the `z-index: 999999` Nightmare

Every web developer has encountered this disaster: an engineer wants a modal to sit on top of a sticky header, so they write z-index: 999. Another engineer wants a toast to sit on top of the modal, so they write z-index: 999999. Soon, the codebase is an unmaintainable war of arbitrary numbers.

A design system ends this chaos with a strict, tokenized Z-Index scale:

  • z-index-base: 0 (Standard document flow)
  • z-index-dropdown: 100 (Dropdown menus, autocomplete popovers)
  • z-index-sticky: 200 (Sticky navigation bars, fixed headers)
  • z-index-backdrop: 400 (Modal backdrop dimming overlay)
  • z-index-modal: 500 (Modal dialogs, side drawers)
  • z-index-toast: 1000 (Global system notifications, toasts)

By banning arbitrary z-index numbers and enforcing tokens via linters, UI elements layer in predictable, perfect order.

Topics

The Physical Model of Digital Elevation
Multi-Layer Shadows: Ambient + Directional Light
The 5 Systemic Elevation Tiers
Elevation in Dark Mode: Surface Tints Over Shadows
Tokenizing Z-Index: Ending the `z-index: 999999` Nightmare
Stacking Context Traps in CSS
Motion & Elevation: Hover Lifts and Transitions
Glassmorphism & Frosted Backdrops (`backdrop-filter`)
Challenge: Resolving a Complex Z-Index & Overlay Collision
design

From lesson

3

Elevation, Z-Index & Spatial Depth

Level 4 · Component Architecture & Visual Language

Top contributors

Community contribution details will appear here once real learner activity is available.

Share