Foundations

Elevation & Shadows

The elevation scale ranges from Level 0 (base) to Level 4, representing five distinct elevation levels. Each level pairs a key and ambient shadow to communicate depth, hierarchy, and interactivity across government service interfaces, from cards at rest to focused modals.

Elevation levels

Five levels provide progressive depth. Each level composes a key shadow with an ambient shadow, and maps to a specific UI context. Values match the Figma shadow tokens exactly.

Level 0

Level 0

Flat, flush surfaces — content on the page plane, disabled states.

none
Level 1

Level 1

Cards at rest — subtle lift to separate from the background.

Key: Y: 1, Blur: 2
Ambient: Y: 1, Blur: 2
0px 1px 2px 0px var(--ux4g-elevation-color-1), 0px 1px 2px 0px var(--ux4g-elevation-color-1)
Level 2

Level 2

Raised cards and dropdowns — hover states and select panels.

Key: Y: 4, Blur: 8
Ambient: Y: 1, Blur: 2
0px 4px 8px 0px var(--ux4g-elevation-color-2), 0px 1px 2px 0px var(--ux4g-elevation-color-1)
Level 3

Level 3

Popovers and menus — content that floats above the surface.

Key: Y: 8, Blur: 16
Ambient: Y: 4, Blur: 8
0px 8px 16px 0px var(--ux4g-elevation-color-4), 0px 4px 8px 0px var(--ux4g-elevation-color-2)
Level 4

Level 4

Modals and dialogs — the highest, most focused layer.

Key: Y: 16, Blur: 32
Ambient: Y: 8, Blur: 16
0px 16px 32px 0px var(--ux4g-elevation-color-6), 0px 8px 16px 0px var(--ux4g-elevation-color-4)

Depth & layering rules

Each UI layer has a defined purpose and stacking order. Never skip layers.

Basevar(--ux4g-z-layout-base)Page content, static elements
Raisedvar(--ux4g-z-layout-raised)Interactive cards, buttons with lift
Overlayvar(--ux4g-z-layout-overlay)Panels that cover content
Topvar(--ux4g-z-layout-top)Focused dialogs blocking interaction

Z-index scale

A fixed scale prevents z-index wars. These numbers represent z-index token values that define the stacking order of UI elements, where higher values are rendered above lower values. Always use tokens instead of arbitrary values.

1000

dropdown

Dropdown menus, select panels

1020

sticky

Sticky headers, fixed navbars

1030

fixed

Fixed positioning elements

1040

offcanvas

Offcanvas menus

1050

modal-backdrop

Modal backdrops

1060

modal

Modal dialogs, lightboxes

1070

popover

Popovers

1080

tooltip

Tooltips

1090

toast

Toast notifications

Usage guidelines

Elevation communicates interactivity and importance. Use it intentionally.

Dos

  • • Use Level 1 for resting cards to separate them from the background
  • • Raise to Level 2 on hover/focus for interactive elements
  • • Reserve Level 3 and Level 4 for popovers, menus, and modals
  • • Pair elevation with a border for low-contrast themes

Don'ts

  • • Don't apply Level 4 to inline or resting elements
  • • Don't stack multiple elevated elements at the same z-level
  • • Don't use elevation as the only visual differentiator
  • • Don't use arbitrary z-index values outside the scale

Dark mode adjustments

Shadows are less visible on dark backgrounds. In dark mode the Figma tokens switch to light-tinted key and ambient shadows; pair them with subtle borders for edge definition.

/* Dark mode: key + ambient shadows use light tints */

--ux4g-shadow-l1: 0px 1px 2px 0px rgba(255,255,255,0.08), 0px 1px 2px 0px rgba(255,255,255,0.04);

--ux4g-shadow-l2: 0px 4px 8px 0px rgba(255,255,255,0.12), 0px 1px 2px 0px rgba(255,255,255,0.08);

/* Pair with border-border for edge definition */

Code usage

Apply elevation via CSS custom properties or the equivalent utility classes.

Elevation levels

Level 0 → flat / flush

Level 1 → cards at rest

Level 2 → raised cards, dropdowns

Level 3 → popovers, menus

Level 4 → modals, dialogs

CSS custom properties

var(--ux4g-shadow-l1)

var(--ux4g-shadow-l2)

var(--ux4g-shadow-l3)

var(--ux4g-shadow-l4)

var(--ux4g-z-modal): 1060;

UX4G Accessibility Tool
Dictionary
UX4G Accessibility Tool
Dictionary