Why Single-Layer Box Shadows Look Fake
Real-world light sources are area emitters rather than mathematical points. As shadow spreads further from an object, it softens and diffuses naturally. A single-layer CSS shadow produces an abrupt, muddy halo, making UI cards appear flat and artificial.
Physics of Multi-Layer Gaussian Attenuation
By layering between 2 and 6 subtle shadows calculated along an exponential power curve, Lucentool establishes both crisp near-field ambient occlusion and broad ambient diffusion. The result is a luminous, high-end tactile depth.
Tailwind CSS Integration
- Arbitrary Values: The generator outputs optimized arbitrary class names ready to paste into JSX/HTML without editing tailwind.config.js.
What happens in the page
computeShadow() builds a box-shadow stack from three inputs: the number of layers, the maximum elevation and a colour. Each layer gets a vertical offset, a blur radius and an opacity scaled to its position in the stack, so the first layer is a tight contact shadow and the last is a wide, faint ambient one. hexToRgb() splits the colour so the opacity can be applied as rgba() per layer instead of fading the whole element. The output is one declaration you paste into a rule.
Where it breaks down
The shadows are geometric fakes — they do not know what is casting them, so a circle gets the same stack as a rectangle unless you adjust the spread yourself. More than about six layers makes the declaration long without looking better, and very large blur radii are expensive to composite on low-end phones. Because opacity is derived from the base colour, a saturated colour produces a visibly tinted shadow, which is rarely what a light source would do.
Privacy: no data leaves this tab
The colour and geometry you enter are turned into a CSS declaration in memory; the page loads no remote assets for this and stores nothing, so a design system draft is not recorded anywhere.
Frequently asked questions
How many layers should I use?
Three to five covers most interface cards. Beyond six the declaration grows and the visual gain flattens.
Why does my shadow look coloured?
Because the colour you picked is used at reduced opacity rather than black. Use a low-saturation grey or near-black for a neutral shadow.
Can I apply it to text?
No — this generates box-shadow. Text needs text-shadow, which is a different property with different parameters.