Elevation scale

Six levels from flat (0) to maximum depth (5). Each level maps to a --dv-elevation-N token. In light mode these are progressively larger, softer box-shadows. In dark mode the shadow values are tighter and darker — surface tinting (see below) carries the depth instead.

elevation-0
Flat — no shadow. Base page layer.
Body, inline content
elevation-1
Hair-thin lift. Subtle separation from the page.
Buttons (resting), chips
elevation-2
Gentle rise. Clearly above the base surface.
Buttons (hover), cards
elevation-3
Moderate lift. Distinct layering.
Dropdowns, popovers
elevation-4
Strong presence. Clearly floating over content.
Modal, Drawer
elevation-5
Maximum depth. Full overlay presence.
Menu, context menus
/* Apply to any element */
.my-card   { box-shadow: var(--dv-elevation-2); }
.my-modal  { box-shadow: var(--dv-elevation-4); }
.my-tooltip { box-shadow: var(--dv-elevation-5); }

Named shadows

A separate set of decorative shadow tokens — xs through xl — for cases where you want a specific visual weight independent of the component layer hierarchy. These use a multi-layer technique (ambient base + directional spread) for a softer, more diffuse look than the elevation tokens.

shadow-xs
Hairline ambient shadow. Matches elevation-1.
--dv-shadow-xs
shadow-sm
Small spread with a subtle ambient base layer.
--dv-shadow-sm
shadow-md
Medium spread. Generous floating feel.
--dv-shadow-md
shadow-lg
Large spread. Soft and diffuse.
--dv-shadow-lg
shadow-xl
Extra-large spread. Maximum decorative depth.
--dv-shadow-xl
/* Paper component accepts a shadow prop */
.decorative-card { box-shadow: var(--dv-shadow-md); }
.hero-image      { box-shadow: var(--dv-shadow-xl); }

Surface layers

The --dv-surface-N tokens define background colors that step upward through the layer stack. In light mode these stay near-white — shadow contrast communicates depth. In dark mode, where shadows are less visible, each surface level picks up a progressively stronger tint of the primary color so the stack remains readable without shadows alone.

The tinting uses color-mix() (Chrome 111+, Firefox 113+, Safari 16.2+). Older browsers receive static dark-gray fallbacks.

--dv-surface-0
Page background
var(--dv-color-body)
--dv-surface-1
Sidebar, nav, primary panels
var(--dv-color-surface)
--dv-surface-2
Cards, inputs, secondary panels
var(--dv-color-gray-1)
--dv-surface-3
Modal / drawer backgrounds
var(--dv-color-body)
--dv-surface-4
Floating panels
var(--dv-color-body)
--dv-surface-5
Tooltips, top-most overlays
(dark only)
/* Surface scale — use these on element backgrounds */
.page-bg     { background: var(--dv-surface-0); }
.sidebar     { background: var(--dv-surface-1); }
.card        { background: var(--dv-surface-2); }
.modal-body  { background: var(--dv-surface-3); }

Component usage

These tokens are applied consistently across all built-in components.

ComponentElevation tokenSurface token
Buttonelevation-1 (rest) → elevation-2 (hover)
Paperconfigurable via shadow propsurface-2
Cardelevation-2surface-2
Modalelevation-4surface-3
Drawerelevation-4surface-3
Menuelevation-5surface-2
Tooltipelevation-5surface-2
Notificationelevation-3surface-2

CSS Variable Reference

TokenLight modeDark mode
--dv-elevation-0nonenone
--dv-elevation-10 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.1)0 1px 3px rgba(0,0,0,0.3)
--dv-elevation-20 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06)0 4px 5px rgba(0,0,0,0.35)
--dv-elevation-30 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05)0 6px 6px rgba(0,0,0,0.4)
--dv-elevation-40 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04)0 8px 7px rgba(0,0,0,0.45)
--dv-elevation-50 25px 50px rgba(0,0,0,0.25)0 10px 8px rgba(0,0,0,0.5)
--dv-shadow-xs--dv-shadow-xlStatic — same in both modes. Multi-layer ambient + directional.
--dv-surface-0var(--dv-color-body) — #ffffff#1a1b1e
--dv-surface-1var(--dv-color-surface) — #f8f9facolor-mix(primary 5%, surface-0)
--dv-surface-2var(--dv-color-gray-1) — #f1f3f5color-mix(primary 8%, surface-0)
--dv-surface-3var(--dv-color-body)color-mix(primary 11%, surface-0)
--dv-surface-4var(--dv-color-body)color-mix(primary 12%, surface-0)
--dv-surface-5color-mix(primary 14%, surface-0)