Shadows

One shadow for menus and popups, a deeper one for dialogs, and the soft shadows that give fields and buttons their edge, each with a light and a dark value.

Shadow tokens

Each shadow is a CSS variable with its own value in light and in dark: a shadow on a dark page has to be much denser to show at all. The samples follow the page's theme, so switch it to see the other. A popup draws its edge with ring-1 ring-hairline and its lift with shadow-(--popover-shadow). A soft surface gets its ring, its lit edge and a faint lift from one shadow-soft class.

Elevation

TokenSampleUsed by
--popover-shadowDropdown Menu, Context Menu, Select, Combobox, Popover, Navigation Menu, Toast.
--dialog-shadowDialog and Alert Dialog, a step deeper than a menu.

Soft surfaces

TokenSampleUsed by
--shadow-softThe soft Button, fields (Input, Textarea, Select, Combobox, Native Select), Checkbox, Radio Group, Tabs, Segmented Control, Toolbar.
--shadow-soft-hoverA field under the pointer: Input, Textarea, Select, Native Select, Checkbox, Radio Group.
--shadow-soft-invalidAn invalid field: the ring takes the destructive red.
--shadow-soft-invalid-hoverAn invalid field under the pointer.
--shadow-accent-softThe accent-soft Button.
--shadow-brand-softThe brand-soft Button.

Change a shadow

Set the variable in both theme blocks, and every menu or every dialog takes the new value. The soft shadows read --soft-lift, --soft-edge and --soft-ring, so you change those colors instead.

:root {
  --popover-shadow: 0 8px 24px -6px --alpha(var(--color-gray-900) / 16%);
}

.dark,
[data-theme="dark"] {
  --popover-shadow: 0 8px 24px -6px --alpha(var(--color-black) / 60%);
}