Shadow and layers
There are only three shadows, and all of them are faint. When white space and a change of background can separate the layers, don’t add a shadow.
--hao-shadow-card
Cards. Very light, like paper floating on a desk. At night a black shadow can’t be seen on a dark ground, so it adds a very faint light edge.
--hao-shadow-float
Overlays and raised menus. At night it adds the same light edge, so overlays have a boundary.
--hao-shadow-thumb
Switch thumbs and the selected block of segmented controls.
Stacking order
| Token | Value | Use |
|---|---|---|
--hao-z-nav | 100 | Sticky navigation bars and fixed bottom tab bars. |
--hao-z-sheet | 200 | Scrims and bottom sheets. |
--hao-z-dialog | 300 | Dialogs. |
--hao-z-popover | 350 | Menus and popovers. Higher than dialogs, so they remain visible when opened inside a dialog. |
--hao-z-toast | 400 | Toasts; always on top. |
Opacity
| Token | Value | Use |
|---|---|---|
--hao-opacity-disabled | 0.4 | Disabled controls drop to this opacity as a whole. |
--hao-opacity-pressed | 0.85 | The moment of pressing. |
Motion
| Token | Value | Use |
|---|---|---|
--hao-dur-fast | 120ms | Press, hover, and check. |
--hao-dur-base | 200ms | Switches, segmented sliders, and tab changes. |
--hao-dur-slow | 320ms | Dialogs, bottom sheets, and page transitions. |
--hao-ease-out | cubic-bezier(.2, .8, .2, 1) | Enter: fast start, slow stop. |
--hao-ease-in-out | cubic-bezier(.4, 0, .2, 1) | Position movement. |