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
| Token | Sample | Used by |
|---|---|---|
--popover-shadow | Dropdown Menu, Context Menu, Select, Combobox, Popover, Navigation Menu, Toast. | |
--dialog-shadow | Dialog and Alert Dialog, a step deeper than a menu. |
Soft surfaces
| Token | Sample | Used by |
|---|---|---|
--shadow-soft | The soft Button, fields (Input, Textarea, Select, Combobox, Native Select), Checkbox, Radio Group, Tabs, Segmented Control, Toolbar. | |
--shadow-soft-hover | A field under the pointer: Input, Textarea, Select, Native Select, Checkbox, Radio Group. | |
--shadow-soft-invalid | An invalid field: the ring takes the destructive red. | |
--shadow-soft-invalid-hover | An invalid field under the pointer. | |
--shadow-accent-soft | The accent-soft Button. | |
--shadow-brand-soft | The 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%);
}