CSS Shadow Generator
Build a box-shadow one layer at a time. Each layer has its own X and Y offset, blur radius, spread, color, opacity, and an inset toggle. All layers combine on a preview card that uses your site theme's surface color, and the CSS box shows the comma-separated declaration. Stacked soft shadows often look more natural than a single one, which is the reason to use several layers here instead of one big blur.
How to build a layered shadow
- A first layer is added for you (0 offset X, 4px offset Y, 8px blur, black at 20 percent). Edit it with the sliders.
- Adjust X Offset and Y Offset (-50 to 50px), Blur Radius (0 to 100px), Spread (-50 to 50px), and Opacity (0 to 100 percent).
- Pick a Color and tick Inset Shadow if the shadow should be inside the box.
- Press Add Layer to stack another, or Remove to delete one. With no layers the output is
box-shadow: none;. - Press Copy CSS to copy the full
box-shadowdeclaration.
Why stacking shadows looks more realistic
Real light does not make one uniform blur. Contact shadows are tight and dark, while ambient shadows are wide and faint. In CSS you can approximate that by layering: a small offset with low blur for the contact edge, then a larger offset and blur at lower opacity for the soft falloff. The first shadow in the list paints on top, which only matters when layers differ in color; new layers here are always added at the end.
Spread grows or shrinks the shadow shape before blurring, so a negative spread with a large Y offset gives a shadow that tucks under the card instead of showing at the sides. Colors are written as rgba() built from the picker's hex and your Opacity value, which lets shadows pick up a tint from your palette, though pure black at low opacity is the safest default. Heavy blur on many layers can slow repaints on large elements.