WordPress
Shadows should typically support the visual hierarchy and be used consistently – for example, Level 1 for clickable elements, Level 2 for fixed elements, and Level 3 for modal elements or similar. In code, the variables are numbered sequentially so they can be easily adjusted and extended.
Level 0
Level 1
--wp--preset--shadow--1
Level 2
--wp--preset--shadow--2
Level 3
--wp--preset--shadow--3
z-index
We have prepared a set of five custom variables in theme.json, to consistently apply z-index to elements.
| CSS Variable | z-index-Wert | Zweck |
|---|---|---|
--wp--custom--z-index--level-1 | 10 | Core elements (mostly interactive) that needs increased z-index to apply correct tap-areas, current-states etc. |
--wp--custom--z-index--level-2 | 20 | Navigation backdrop (deprecated as far as we implement popover and native backdrops) |
--wp--custom--z-index--level-3 | 30 | Sticky headers etc. |
--wp--custom--z-index--level-4 | 40 | dialogs |
--wp--custom--z-index--level-5 | 50 | Accessibility: Skip links, visible focus-states etc. |