08 use shadows appropriately

From gnurio/refactoring-ui-plugin · View interactive version

08 use shadows appropriately is an AI agent skill from the GitHub repository gnurio/refactoring-ui-plugin. Add depth only when functionally necessary (elevation, not decoration)

How to use this skill

Skill file

Skill: Use Shadows Appropriately

Purpose

Add depth and elevation only when functionally necessary, avoiding decorative shadows.

Key Fix Applied (from Autoresearch)

Added nuance: Subtle shadows on cards are acceptable (less distracting than borders). Large decorative shadows on static elements are wrong.

Type

Corrective + Evaluative

Input

Output

Transformation Performed

Removes decorative shadows from static elements, reserves shadows for elevation layers (modals above content, dropdowns above page).

Decision Criteria

PASS (Appropriate Shadow Usage)

FAIL (Inappropriate Shadow Usage)

Nuance (Key Insight)

Subtle shadows (small blur, low opacity) on cards are OK. The book recommends them as alternative to borders. Large, flashy shadows on static content are wrong.

Shadow Elevation Scale

| Level | Use Case | CSS Example (approximate) |

|-------|----------|---------------------------|

| None | Static content, text, icons | none |

| Subtle | Cards (alternative to borders) | 0 2px 4px rgba(0,0,0,0.1) |

| Low | Raised cards, buttons | 0 4px 6px rgba(0,0,0,0.1) |

| Medium | Dropdowns, popovers, tooltips | 0 10px 15px rgba(0,0,0,0.1) |

| High | Modals, dialogs, drawers | 0 20px 25px rgba(0,0,0,0.15) |

Shadow Principles

  1. Shadows indicate elevation - Higher = closer to user
  2. Shadows indicate interactivity - Clickable things can have shadow
  3. Shadows separate layers - Modal casts shadow on page behind it
  4. Shadows should be subtle - Good shadows are barely noticeable
  5. Consistency matters - Same elevation = same shadow

Common Failure Modes

| Failure | Description | Fix |

|---------|-------------|-----|

| Shadow Carpet | Every card has a shadow | Flatten static cards, subtle shadows OK |

| Drop Shadow Abuse | Heavy shadows on static elements | Reserve for elevation/interaction |

| Inconsistent Depth | Similar elements different shadows | Create 2-3 shadow levels, apply consistently |

| Black Shadows | Pure black shadows (harsh) | Use rgba with low opacity, tinted to brand |

| No Modal Separation | Modal doesn't feel above page | Increase shadow spread and blur |

Prerequisites

Dependencies

Refactoring UI References

Example Assessment

Input: Page with card shadows (0 4px 6px rgba(0,0,0,0.1)), button shadows (0 2px 4px), modal shadow (0 4px 6px), text with text-shadow

Evaluation: FAIL (cluttered)

Recommendation:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.