Loading...
Loading...
Elevation — subtle shadows and layering — communicates visual hierarchy by lifting elements above the surface. Combined with border-radius, it creates the tactile quality of cards, modals, and interactive surfaces. Use when designing cards, dropdowns, modals, tooltips, or any floating UI element.
npx skill4agent add dembrandt/dembrandt-skills elevation-and-depth| Level | Token | Shadow | Role |
|---|---|---|---|
| 0 | | none | Flat surface, inline elements |
| 1 | | | Subtle card, table row hover |
| 2 | | | Card, input focus ring area |
| 3 | | | Dropdown, popover |
| 4 | | | Modal, dialog, side drawer |
| 5 | | | Command palette, full-screen overlay |
#E2E8F0grey-200| Surface | Shadow | Border-Radius | Tone |
|---|---|---|---|
| Inline chip / tag | none | | Flat, lightweight |
| Card | | | Graspable, contained |
| Dropdown / popover | | | Floating, contextual |
| Modal / dialog | | | Prominent, focused |
| Toast / notification | | | Ephemeral, above content |
| Button | none or | consistent across all buttons — see below |
/* Correct: one radius for all buttons */
.btn { border-radius: var(--radius-button); }
/* Wrong: different radii for different button variants */
.btn-primary { border-radius: 8px; }
.btn-secondary { border-radius: 4px; } /* ← breaks consistency */text-shadow/* On images or complex backgrounds */
.hero-title {
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
/* Very subtle separation from a near-matching background */
.label-on-tinted-surface {
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
/* White text on light background — use a dark shadow, not white */
.inverted-text {
text-shadow: 0 1px 4px rgba(0, 0, 0, 0.30);
}0.302–4px0 1px0 0text-shadow1px solid rgba(255,255,255,0.08)| Anti-pattern | Problem | Fix |
|---|---|---|
| Different border-radius on primary vs secondary buttons | Implies semantic difference that doesn't exist | Single |
Heavy | Feels dated and visually aggressive | Use low-opacity, multi-layer diffuse shadows |
| Shadow on every element regardless of role | Elevation loses meaning when everything is elevated | Reserve shadow for genuinely floating elements |
| Flat cards with no elevation on a white background | Card edge disappears into the page | Use |