Agentic Design System
v3.5.0

Foundations · Shadows

Shadows

Shadow is an elevation system, not decoration - it answers one question: how far above the surrounding surface does this sit? Use the smallest elevation that communicates the right layer, and never rely on shadow alone for focus, selection or state.

Shadow philosophy

The elevation character every card, dropdown, panel and overlay in this system follows. Balanced is the global default unless your product type above recommends otherwise.

Elevation hierarchy

Semantic elevation layers, not arbitrary box-shadow values - each answers "how far above the surface does this sit?"

Base Page, section, table rows - same surface, no elevation needed None
Raised Standard cards, slightly raised controls, sticky elements XS · SM
Dropdown / Popover Clearly elevated above the content beneath - menus, date pickers MD
Floating / Drawer Floating panels, toolbars, side drawers LG
Modal Dialogs and modals - pair with a backdrop and surface contrast, not shadow alone XL
Major overlay Complex overlays and large floating experiences - use sparingly 2XL

Component defaults

Button Default none · hover XS · pressed none - don't make every button look elevated None / XS
Input Default none · focus uses a visible ring, never shadow alone None
Card (static) A bordered display-only card uses no shadow. An explicitly elevated surface can use SM; neither changes on hover because it has no action. None / optional SM
Card (interactive) A real <a>/<button> (or explicitly marked --interactive) - the whole card is one click target, so its elevation should say so: default SM → hover MD → pressed XS SM → MD → XS
Dropdown / Popover Should clearly appear above the content beneath it MD
Tour step / Pop confirm Anchored callouts - the same level as a popover MD
Toast / Notification Transient messages that sit above page content but below dialogs LG
Tooltip Stays visually lightweight - never heavier than a card SM
Modal / Dialog Pair with backdrop + surface contrast, not shadow alone XL
Drawer / Bottom sheet Side drawer LG · mobile bottom sheet XL - edge touching the viewport stays unrounded, not unshadowed LG / XL
Floating action button Default MD · hover LG · pressed SM (shown in that order) MD / LG / SM
Sticky header None until scrolled, then XS - never a permanent strong shadow None / XS
Table Borders and row separation do the work - avoid shadows between rows None
Navigation (sidebar, topbar) A border does the separating (this shell's own sidebar/topbar use a border, not a shadow) - reach for Sticky header's rule only once nav starts overlapping scrolling content None

Shadows and interaction states

"Never shadow alone" needs a concrete second signal per state, not just the principle - here's what this system actually uses for each, with the real rule behind it:

Focus A visible outline/ring, never elevation - confirmed: every real input's focus state uses outline: 2px solid var(--color-focus-ring), not a box-shadow change Outline
Selected Border color change, plus a solid (not blurred) box-shadow ring used as an outline substitute, not elevation - confirmed: Card's own .is-selected pairs border-color with box-shadow: 0 0 0 1px, a flat ring, not a soft elevation shadow Border + solid ring
Pressed Background color change on :active, confirmed across every real Button type - :active fires reliably on touch (press-and-hold), unlike :hover, which doesn't fire at all on most touch devices and shouldn't be the only pressed cue Background

Reduced motion is already handled sitewide, not per-shadow: a global @media (prefers-reduced-motion: reduce) rule collapses every transition and animation duration to near-zero - a shadow's own hover/press transition inherits this automatically, no separate opt-out needed per component.

Performance: a box-shadow transition repaints the shadow itself every frame - it isn't compositor-accelerated the way transform/opacity are. Keep shadow transitions short and triggered only by a real state change (hover, press, a panel opening) - never continuous, looping or scroll-linked, which is where an animated box-shadow's real cost shows up.

For developers and AI agents: Markdown export and implementation contract

Shadow tokens - Markdown export

Copy the shadow guidance and current applied philosophy, including px and rem recipes. The export updates when settings change.

Implementation contract

Saved validated choices override project recommendations, which override system defaults. This implementation contract governs static specimens. Resolved tokens in the current export are authoritative values. Component exceptions must name the affected role and reason.

Philosophy algorithm

Flat removes all shadows. Subtle/Balanced/Soft/Expressive multiply y-offset and blur by 0.5/1/1.4/2 while retaining recipe opacity (in the dark theme the recipe alpha is multiplied by 2.5, capped at .6, because black shadows at the light-theme alpha disappear on near-black surfaces). xs through 2xl use y/blur/alpha: 1/2/.06,1/4/.08,4/8/.10,8/16/.12,12/24/.14,16/32/.16. Export resolved offsets, blur, spread, color and inset rather than just philosophy names.

Card variants

Static bordered cards use no shadow. Explicitly elevated static cards use SM with no hover change. Interactive cards use SM at rest, MD on hover and XS when pressed. Focus uses an outline. Flat philosophy removes these shadows while borders/surfaces retain separation.

Modes and alternatives

Dark surfaces and custom palettes must be checked for actual layer separation. Use surface and boundary tokens when shadow is invisible. Forced colors and print preserve boundaries and remove decorative shadow. Do not make a shadow the only sign of a control or modal.

Layers

Use the shared layer map: content 0, sticky 20, popover 40, scrim 60, dialog 70, toast 80, tooltip 90. Portal overlays out of clipped containers, assign focus ownership, close the top layer with Escape, restore trigger focus and test nested owners/collisions. Elevation magnitude is not z-index.

Motion and export

Apply hover/pressed effects only to actionable cards. Reduced motion removes animated elevation; touch has no hover requirement. Export both theme recipes, philosophy mapping, card variants, layer map, focus/clip rules and px/rem equivalents.

Save and edit

Selections preview immediately. Save foundation commits valid settings in this browser and locks the editor. Select Edit foundation to revise saved settings; Cancel retains the saved settings. Storage failure keeps the draft editable.

Machine contract: section rules, storage, units and acceptance
{
  "schemaVersion": 1,
  "authority": "Saved validated choices override project recommendations, which override system defaults. This implementation contract governs static specimens. Resolved tokens in the current export are authoritative values. Component exceptions must name the affected role and reason.",
  "governance": {
    "owners": "Design System Lead owns token and compatibility policy. Designers own specimens and interaction contracts. Developers own resolver/export/import parity. QA and Accessibility own release evidence. Product teams own domain-specific confidence, privacy and retention policies.",
    "changes": "Change the JSON contract first, regenerate documentation/defaults/catalog/tokens, then run model, DOM and recipient checks. Link the changed finding IDs and evidence in the release review.",
    "compatibility": "Keep hue-named CSS tokens as compatibility aliases while semantic consumers migrate. Additive tokens retain schemaVersion 1. A removed/renamed key or changed stored meaning requires a schema migration, a version bump and a documented replacement before release. Keep the prior reader fixture until the migration is verified.",
    "deprecation": "Record old key, replacement, reason, introduced version, planned removal version and affected consumers. Do not remove a token while an active consumer still uses it. Future records are preserved rather than coerced.",
    "scope": "This is a web design system with one shared workspace profile. Native dp/sp adaptation and real agent execution require separate adapters and acceptance. User-defined colors and responsive exceptions require product-specific rendered verification."
  },
  "storage": {
    "version": 1,
    "legacy": "Unversioned valid records migrate in memory. Typography headingScaleVersion 2 applies the smaller six-heading scale once to older records, retaining other roles and existing font/color/style metrics. Later custom size edits are retained. Unsupported future records are preserved. The next successful write stamps the migrated version.",
    "future": "Reject unsupported future versions. Preserve raw data. Offer backup and explicit reset.",
    "invalid": "Foundation selections preview locally until Save foundation succeeds. Saved Foundation editors require Edit foundation before changes. Cancel discards the preview. Invalid drafts never replace saved records; storage failures retain the editable preview and the last durable record.",
    "concurrency": "A storage event refreshes applied tokens and disables stale editor controls until reload. Never merge simultaneous edits silently."
  },
  "units": {
    "base": "1rem = 16px at default browser settings. Do not fix the root font size.",
    "use": "Prefer rem for typography, spacing and control dimensions. Hairline borders and viewport thresholds may use px. Both equivalents appear in Markdown. SVG strokes use viewBox units. Ratios, percentages, columns, timing and weights are unitless or retain their own units.",
    "native": "Web CSS px/rem are not native dp/sp. A native adapter must map semantic roles, support text scaling and test device density. Native rendering is not shipped by this web library."
  },
  "acceptance": [
    "Compare page, applied tokens, durable record, Machine View and exported instructions.",
    "Test valid, unfinished, invalid, missing, malformed, legacy and future records. Exercise storage failure, reset, reload and another tab.",
    "Test 320, 375, 768, 1024 and 1440px widths, 200% zoom, text-spacing overrides, RTL and long/localized labels.",
    "Use keyboard and screen reader. Confirm focus return, names, values, error associations and status announcements.",
    "Verify actual rendered text/surface pairs, forced colors, reduced motion, print and exported recipes in a recipient fixture. Source or DOM checks alone are not rendered acceptance."
  ],
  "layers": {
    "content": 0,
    "sticky": 20,
    "popover": 40,
    "scrim": 60,
    "dialog": 70,
    "toast": 80,
    "tooltip": 90,
    "rules": "Each overlay gets an explicit owner and close/focus-return path. Portal menus out of clipped scroll containers. Nested dialogs stack one scrim per modal owner. Escape closes the top dismissible layer. Tooltips never block actions. Test collision and zoom; do not infer stacking order from shadow size."
  },
  "section": {
    "title": "Shadows",
    "rules": {
      "Philosophy algorithm": "Flat removes all shadows. Subtle/Balanced/Soft/Expressive multiply y-offset and blur by 0.5/1/1.4/2 while retaining recipe opacity (in the dark theme the recipe alpha is multiplied by 2.5, capped at .6, because black shadows at the light-theme alpha disappear on near-black surfaces). xs through 2xl use y/blur/alpha: 1/2/.06,1/4/.08,4/8/.10,8/16/.12,12/24/.14,16/32/.16. Export resolved offsets, blur, spread, color and inset rather than just philosophy names.",
      "Card variants": "Static bordered cards use no shadow. Explicitly elevated static cards use SM with no hover change. Interactive cards use SM at rest, MD on hover and XS when pressed. Focus uses an outline. Flat philosophy removes these shadows while borders/surfaces retain separation.",
      "Modes and alternatives": "Dark surfaces and custom palettes must be checked for actual layer separation. Use surface and boundary tokens when shadow is invisible. Forced colors and print preserve boundaries and remove decorative shadow. Do not make a shadow the only sign of a control or modal.",
      "Layers": "Use the shared layer map: content 0, sticky 20, popover 40, scrim 60, dialog 70, toast 80, tooltip 90. Portal overlays out of clipped containers, assign focus ownership, close the top layer with Escape, restore trigger focus and test nested owners/collisions. Elevation magnitude is not z-index.",
      "Motion and export": "Apply hover/pressed effects only to actionable cards. Reduced motion removes animated elevation; touch has no hover requirement. Export both theme recipes, philosophy mapping, card variants, layer map, focus/clip rules and px/rem equivalents.",
      "Save and edit": "Selections preview immediately. Save foundation commits valid settings in this browser and locks the editor. Select Edit foundation to revise saved settings; Cancel retains the saved settings. Storage failure keeps the draft editable."
    }
  }
}