Shadows

Shadow utilities create depth and elevation. All shadows use black with configurable opacity that automatically adjusts for dark mode. Larger shadows use multiple layers for realistic lighting, mimicking how real-world objects cast both sharp and diffuse shadows.

Shadow Sizes

Available shadows
shadow-sm

Subtle lift for hover states

shadow-md

Cards, buttons, floating elements

shadow-lg

Modals, dropdowns, popovers

shadow-xl

High elevation overlays

Classes: .shadow-none, .shadow-sm, .shadow-md, .shadow-lg, .shadow-xl

Multi-Layer Shadows

Every shadow level compounds multiple layers for realism. A tight contact shadow defines the edge while softer ambient layers create atmospheric depth. This mimics real-world lighting where objects cast both direct and indirect shadows. shadow-lg uses three layers; shadow-xl uses four.

Single layer

shadow-sm

Two layers

shadow-md

Two layers

shadow-lg

Multi-layer shadows look more natural than single shadows at the same blur radius

Dark Mode Behavior

Shadows automatically adjust for dark mode. The --shadow-strength variable increases from 0.1 (light) to 0.25 (dark), making shadows more pronounced against dark backgrounds. This maintains depth perception without becoming invisible.

Light mode: --shadow-strength: 0.1 (subtle, natural)
Dark mode: --shadow-strength: 0.25 (visible, maintains depth)
Toggle dark mode in the header to see shadows adapt automatically

Customization

The shadow system has two knobs. --shadow-strength controls base opacity. --shadow-color sets the hue and saturation (HSL components, no alpha). Change the color to warm or cool your shadows across the board.

/* config.css -- defaults */
--shadow-color: 0 0% 0%;      /* Pure black */
--shadow-strength: 0.1;        /* Light mode */

.dark {
  --shadow-strength: 0.25;     /* Dark mode */
}

/* Example: warm shadows */
--shadow-color: 30 50% 20%;   /* Brownish tint */

/* Example: cool shadows */
--shadow-color: 220 30% 15%;  /* Blue-gray tint */

When to Use Each Shadow

shadow-sm: Hover states, subtle lift, very slight elevation
shadow-md: Cards, buttons, chips, moderate floating elements (most common)
shadow-lg: Dropdowns, modals, popovers, prominent floating panels
shadow-xl: Full-screen overlays, high-priority notifications, maximum elevation
shadow-none: Remove shadows for flat designs or to reset inherited shadows