Design Tokens

Harmonizing z-index planes and multi-tiered shadow elevations in design systems

Unregulated z-index wars and mismatched drop shadows quickly erode the perceived polish of complex interfaces. Standardizing an elevation scale from grounded card foundations up to urgent floating alert modals establishes an intuitive, self-explanatory hierarchy for users.

Elevation & Shadow Scale

How to Use the Elevation & Shadow Scale (3 Simple Steps)

1

Set Light Source Angle & Ambient Blur

Configure directional light angle, shadow softness dispersion, and ambient light bounce intensity.

2

Preview 5 Elevation Levels

Inspect elevation levels from Level 1 (card resting on surface) up to Level 5 (floating modal dialog or toast notification).

3

Copy Elevation Design Tokens

Copy unified CSS variables (--elevation-1 through --elevation-5) pairing coordinated z-indices and multi-layered shadows.

Features & CSS Best Practices

✓

5 Consistent Elevation Levels

Provides standard elevation steps: Resting Card, Hover Lift, Dropdown Menu, Floating Drawer, and Modal Dialog.

✓

Unified Directional Lighting

Ensures every shadow across your entire web application appears lit from the exact same physical light angle.

✓

Dual-Layer Physical Lighting

Each elevation token combines a crisp directional key shadow with a soft, expansive ambient reflection.

✓

Z-Index Scale Coordination

Optionally outputs matching z-index variables to prevent stacking order chaos across complex user interfaces.

Frequently Asked Questions

Why is an elevation scale necessary in design systems?

Without an elevation scale, different developers invent random shadow values, creating visual inconsistency where menus, modals, and cards clash in lighting angle and depth.

How many elevation levels should a design system have?

Most modern design systems (including Material Design and Ant Design) use 4 to 6 levels to represent resting, hover, dropdown, navigation, and modal states.

Should dark mode shadows be different from light mode shadows?

Yes! In dark mode, drop shadows are less visible against dark backgrounds. Elevation is often conveyed through lighter surface colors (--surface-2, --surface-3) combined with subtle shadows.

Can elevation scales use tinted shadows?

Yes! A subtle blue or purple ambient tint makes dark mode shadows look significantly richer than generic muddy black shadows.

How does an elevation scale represent physical z-axis depth in web design?

Elevation scales use progressive box-shadow spreads and y-axis offsets to simulate light distance. Lower elevations (cards) feature tight, crisp shadows, while higher elevations (modals, dropdowns) cast wide, soft ambient shadows.

How do I create realistic two-layer elevation shadows in CSS?

Combine a direct directional shadow (e.g. 0 4px 6px -1px rgba(0,0,0,0.1)) with a wider ambient diffusion shadow (0 2px 4px -2px rgba(0,0,0,0.1)). Stacking these two layers creates natural physical realism.

How do I adapt elevation shadows for dark mode interfaces?

Because dark shadows are nearly invisible against dark gray backdrops, dark mode elevation combines subtle dark shadows with semi-transparent white surface highlights (e.g. background: rgba(255, 255, 255, 0.05)) to convey depth.