agentleFS
dylantarredylantarre/design-system-skills/skills/tokens/shadow-scale/SKILL.md

shadow-scale

Skill50 starsChanged 11 months agoMITView on GitHub

Generates layered box-shadow elevation tokens for depth hierarchy. Use when creating elevation systems, card shadows, modal depth, or dark mode shadow variants. Outputs CSS, Tailwind, or JSON.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Generate: Create scale with progressive blur/spread/opacity

    line 41
  2. Distinctive:

    Layered shadows: use 2-3 shadow layers per level:

    line 51

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Shadow Scale Generator

Overview

Generate consistent elevation scales using layered box-shadows. Creates depth hierarchy from subtle lifts to dramatic floats with proper blur, spread, and opacity progressions.

When to Use

  • Setting up elevation tokens for a new project
  • Creating card/modal depth hierarchy
  • Standardizing shadow styles across components
  • Building dark mode shadow variants

Quick Reference

LevelTypical UseCharacter
noneFlat elementsNo elevation
xsSubtle liftBarely raised
smCards, buttonsSlight depth
mdDropdowns, tooltipsClear separation
lgModals, popoversFloating
xlDialogs, drawersHigh elevation
2xlFull overlaysMaximum depth

The Process

  1. Get base color: Shadow color (default: black with opacity)
  2. Ask style:
    • Soft - Large blur, low opacity (modern, subtle)
    • Sharp - Small blur, higher opacity (defined edges)
    • Layered - Multiple shadows per level (most realistic)
  3. Ask levels: How many elevation steps (5-7 typical)
  4. Ask dark mode: Generate inverted/adjusted dark mode variants?
  5. Ask format: CSS, Tailwind, or JSON?
  6. Generate: Create scale with progressive blur/spread/opacity

Shadow Styles

StyleCharacterBest For
SoftDiffuse, gentleModern UI, cards, light themes
SharpDefined, crispButtons, data-dense UI
LayeredRealistic, nuancedPremium feel, modals

Layered shadows use 2-3 shadow layers per level:

  • Ambient layer: Large blur, low opacity (environmental light)
  • Key layer: Medium blur, medium opacity (directional light)
  • Edge layer: Minimal blur, subtle (contact shadow)

Output Formats

CSS Custom Properties (Layered):

:root {
  --shadow-none: none;
  --shadow-xs:
    0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm:
    0 1px 3px 0 rgb(0 0 0 / 0.1),
    0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md:
    0 4px 6px -1px rgb(0 0 0 / 0.1),
    0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg:
    0 10px 15px -3px rgb(0 0 0 / 0.1),
    0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl:
    0 20px 25px -5px rgb(0 0 0 / 0.1),
    0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl:
    0 25px 50px -12px rgb(0 0 0 / 0.25);
}

Tailwind Config:

module.exports = {
  theme: {
    boxShadow: {
      'none': 'none',
      'xs': '0 1px 2px 0 rgb(0 0 0 / 0.05)',
      'sm': '0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)',
      'md': '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)',
      'lg': '0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)',
      'xl': '0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)',
      '2xl': '0 25px 50px -12px rgb(0 0 0 / 0.25)',
    }
  }
}

JSON Tokens:

{
  "shadow": {
    "none": { "value": "none" },
    "xs": { "value": "0 1px 2px 0 rgb(0 0 0 / 0.05)" },
    "sm": { "value": "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)" },
    "md": { "value": "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)" },
    "lg": { "value": "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)" }
  }
}

Algorithm Details

Progression factors (each level multiplies previous):

  • Y-offset: ~2x per level
  • Blur radius: ~1.5-2x per level
  • Spread: Slightly negative (prevents harsh edges)
  • Opacity: Increases slightly at higher levels

Layered shadow formula:

Level N:
  Ambient: 0 (N*4)px (N*6)px 0 rgb(0 0 0 / 0.04)
  Key:     0 (N*2)px (N*3)px -(N)px rgb(0 0 0 / 0.08)

Dark Mode Considerations

Shadows are less visible on dark backgrounds. Options:

ApproachHowWhen
Reduce opacityCut opacity 30-50%Subtle dark UI
Add glowLight color, outward spreadNeon/modern aesthetic
Ring highlightSubtle light border + shadowCard separation
Invert directionTop-lit shadowsUnique style

Dark mode CSS example:

:root.dark {
  --shadow-md:
    0 4px 6px -1px rgb(0 0 0 / 0.3),
    0 0 0 1px rgb(255 255 255 / 0.05);
}

Inset Shadows

For pressed states or inner depth:

:root {
  --shadow-inner-sm: inset 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-inner-md: inset 0 2px 4px 0 rgb(0 0 0 / 0.1);
}

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.