Foundations
Shadow
Surfaces stay flat at rest. A shadow appears only when something responds to the user, or floats above the page.
Why we chose this
Shadows are loud, so surfaces stay flat at rest and are separated by warm tints. A shadow appears only when something responds to the user or floats above the page. That keeps the page calm and makes interaction easy to read.
Use it for
- Hovering a card or a button:
shadow-interaction - The moment something is pressed:
shadow-pressed - Dialogs, menus and lightboxes above content:
shadow-large
Don't
- Give cards, panels or fields a shadow at rest. Use
surface-tintor a border. - Write a custom or tinted
box-shadow. - Use a shadow as the only cue. Focus uses the focus ring.
The scale
Anatomy of a shadow value
Every shadow is written x y blur spread color. Ours never move sideways, are always black with a low opacity, and grow in blur as they rise:
Try it
Hover the card, then press it. Rest has no shadow, hover raises it, pressed pushes it back down.
Hover and press me
Where components use it
Light and dark
Shadow values are the same in both themes (black at low opacity). On dark surfaces a black shadow is hard to see, so in dark mode depth mostly comes from the lighter surface-component against the darker surface-page, plus the hairline border-light. Don't rely on a shadow alone to separate things.
light · shadow-large
dark · shadow-large
Rules
| Rule | Reason |
|---|---|
| No shadow at rest on cards, panels or fields. | The system is flat at rest; shadow means "this responds". |
shadow-interaction only on hover, shadow-pressed only while pressed. | The size of the shadow tells you the state. |
shadow-large only for overlays: dialogs, menus above content, lightboxes. | Only things that cover the page should look lifted off it. |
Use the token, never a custom box-shadow. Don't tint shadows with color. | One consistent light source and softness everywhere. |
Animate in about 150ms. Respect prefers-reduced-motion. | Feels responsive, and doesn't bother people sensitive to motion. |
| Shadow is never the only cue. Focus uses the focus ring, selection uses color and a mark. | Soft shadows are invisible to many users. |
.card { border: 1px solid var(--border-light); } /* flat at rest */
.card:hover { box-shadow: var(--shadow-interaction); }
.card:active { box-shadow: var(--shadow-pressed); }
.dialog { box-shadow: var(--shadow-large); }
One large shadow on the dialog that covers the page.
.card { box-shadow: none; }
.card:hover { box-shadow: var(--shadow-interaction); }
.card:active { box-shadow: var(--shadow-pressed); }
.dialog { box-shadow: var(--shadow-large); }Hard offsets, glows or colored shadows.
.card {
box-shadow: 0 10px 30px rgba(167, 94, 42, 0.4);
}