CSS Box Shadow Generator

Stack layers. Name your shadows. Export for CSS or Tailwind.

Named Presets โ€” click to load (also sets background)

Shadow Layer

Light Source

โ˜€
โ† leftright โ†’
โ†‘ topbottom โ†“
sharpdiffuse
contractexpand
#F59E0B
Preview Element

Preview Background

Output Format

Active Layers (2 / 3)

L1: 0px 0px 20px 4px ยท 45%
L2: 0px 0px 48px 0px ยท 22%

๐ŸŽฏ A Simple Example: Designing a Modern Card Component

You're building a portfolio card. You want it to feel gently lifted โ€” airy, with soft depth, not heavy or dramatic.

Steps:

1๏ธโƒฃ Click ๐Ÿชถ Soft Lift โ€” two shadow layers load automatically, background sets to warm parchment. The card in the preview lifts off the surface with a natural, editorial feel.

2๏ธโƒฃ Watch the Light Source compass โ€” the sun icon shows where light is coming from. Drag the V-Offset slider right and watch the sun move. Now you understand what those pixel values actually mean.

3๏ธโƒฃ Click one of the dark backgrounds (slate or midnight) โ€” see if your shadow still reads. A shadow that disappears on dark backgrounds needs more opacity or a coloured glow.

4๏ธโƒฃ Enable Layer 2, set its Blur to 40 and Opacity to 4% โ€” this adds a barely-visible ambient halo that makes the lift feel more three-dimensional.

5๏ธโƒฃ Switch output to Tailwind v3/v4 and paste the shadow-[...] class directly into your JSX. Works with any Tailwind version using arbitrary values.

Pro tip: The โœจ Smooth preset uses exponential layer scaling (offsets: 4 โ†’ 9 โ†’ 21px, blur: 6 โ†’ 16 โ†’ 43px, opacity falling 25% per layer). This mimics how diffuse light physically scatters โ€” each successive layer represents light that has bounced off more surfaces before reaching the shadow. Copy it and use it everywhere you want "premium" depth.

Data Source: MDN Web Docs โ€” box-shadow (Mozilla Foundation, CC BY-SA 2.5) โ€ข Public domain โ€ข Solo-developed with AI

Browse CSS & Web Design Books on Amazon

As an Amazon Associate, I earn from qualifying purchases.

Lab Notes

Why Flat Screens Look Fake โ€” And How Shadow Brought Depth Back to Digital Design

Rembrandt Had It Figured Out in 1630: The painter's legendary use of chiaroscuro โ€” dramatic contrasts between light and dark โ€” wasn't a stylistic flourish. It was a visual technology. The human eye evolved over millions of years to read depth from shadow: the darker a surface, the farther it is from the light source, and therefore the farther it is from you. Rembrandt exploited this ruthlessly, making flat canvases feel three-dimensional. When digital screens arrived in the 1980s, they were genuinely flat โ€” and they looked it. Early UIs had no depth, no hierarchy, no sense that one element was "above" another. The solution, borrowed directly from old painters: add shadow.

The One-Line Trick โ€” and Its Limits: A single CSS box-shadow declaration is simple: offset-x, offset-y, blur, spread, color. Done. But a single layer looks artificial because real shadows don't work that way. Stand a book on your desk and look at its shadow: the edge nearest the book is dark and crisp; farther out, it grows lighter and fuzzier in an exponential curve. That's because light scatters โ€” photons bounce off walls and floors and add fill light from all directions except the blocked one. A single CSS layer can't capture that falloff. The "Smooth" preset in this tool uses three layers with exponentially scaled values (offset roughly ร—2.3 per layer, opacity falling by 25% per layer) to approximate that curve. It's the difference between a department-store price tag and a luxury product photo.

Inset Shadows: The Forgotten Tool: Most developers use box-shadow to make elements appear raised. Flip it: the inset keyword makes elements appear pressed into the surface. The Letterpress preset pairs a bright inset shadow (top-left, white) with a dark inset shadow (bottom-right, black) to simulate a stamp pressed into paper โ€” exactly the technique medieval bookbinders used to emboss leather covers. Neumorphic UI design (circa 2019) built entire design systems around this principle. The technique is timeless because it echoes physical reality: recessed things catch light differently than raised things.

Colour in Shadow โ€” Why Gaslight Works: Real shadows are rarely pure black. Shadows lit by candlelight are amber-tinged; shadows on snow are blue-violet (reflected sky). CSS allows fully coloured shadows, which most generators treat as an afterthought. The Gaslight preset uses amber (#f59e0b) at high opacity for an inner warm halo โ€” the exact effect you'd get photographing a white card next to a candle in a dark room. This is the tool's most brand-specific preset: it belongs to Riatto's vintage aesthetic in a way that "Drop Shadow Type A" never could. Colour shadows are underused in production UI and immediately signal intentional, considered design.

๐Ÿฑ From the Lab Cat's Optical Physics Division: I have observed that my shadow changes shape depending on the angle of the afternoon sun. At 3pm it is short and round (small v-offset, low blur). At 5pm it is long and dramatic (large v-offset, sharp edge). I have tested all six presets by sitting inside each shadow type. The Gaslight preset makes my treat bowl glow magnificently. I have requested it be applied to all furniture immediately. Science is applied aesthetics. ๐Ÿ•ฏ๏ธ๐Ÿพ

In short: These tools are for education and curiosity only. Always verify information independently and consult professionals before making important decisions.

Riatto.ovh ยฉ 2025 โ€“ 2026. Designed and maintained by a solo developer with AI.

Privacy Policy

Also by us: Purr.ovh ยท Snackword.ovh ยท Substack