CSS generator

CSS box shadow generator

Preview
CSS
box-shadow: 0px 2px 4px 0px rgba(15, 15, 18, 0.08), 0px 12px 28px -6px rgba(15, 15, 18, 0.14);
Tailwind
shadow-[0px_2px_4px_0px_rgba(15,15,18,0.08),0px_12px_28px_-6px_rgba(15,15,18,0.14)]

One arbitrary value with the exact CSS inside: spaces become underscores. Works in Tailwind v3 and v4 without touching the config.

Shadow layers2

A CSS value, a box-shadow declaration or a Tailwind shadow-[...] class.

Stack shadow layers, tune each one with sliders, or start from one of 12 presets and watch the preview update live. Copy the box-shadow rule or the matching Tailwind class with one click.

How CSS box shadows work

The box-shadow property takes five parts per layer. The first two numbers are the horizontal and vertical offset. The third is the blur radius, which softens the edge. The fourth is spread, which expands or contracts the shadow before it blurs. The last value is the color, usually written as an rgba() so you can control opacity.

A single shadow can look flat and heavy. The trick professional interfaces use is layering: one tight, darker shadow close to the element for definition, and one wider, lighter shadow further out for ambient depth. That is why this tool is built around layers rather than a single set of sliders.

Recipes worth stealing

  • Subtle card: a 2px vertical offset with an 8 percent black at 4px blur reads as a gentle lift off the page.
  • Floating panel: add a second layer around 12px down, 28px blur, negative spread, at 14 percent, for a modern elevated look.
  • Pressed input: switch a layer to inset with a small blur to suggest a recessed field.

Box shadows in Tailwind CSS

Tailwind's shadow scale stops at a handful of fixed sizes. For anything else, put the value in square brackets. A class cannot contain a space, so each space becomes an underscore; the commas between layers stay. The two layer card preset, for example:

shadow-[0px_1px_2px_0px_rgba(15,15,18,0.06),0px_8px_24px_-4px_rgba(15,15,18,0.10)]

That class produces exactly box-shadow: 0px 1px 2px 0px rgba(15, 15, 18, 0.06), 0px 8px 24px -4px rgba(15, 15, 18, 0.10); and needs no change to your config in Tailwind v3 or v4. The generator writes it for you under the CSS, for every shadow you build.

The 12 presets and when to use them

  • Hairline: A single pixel of separation. Use where a border would be too heavy.
  • Card, resting: Two layers: a tight one for the edge, a wide one for the lift.
  • Card, hover: The resting shadow, pushed further. Animate between the two.
  • Dropdown: Reads as floating above the page without dominating it.
  • Modal: Deliberately heavy. The dialog should feel detached from the page.
  • Inset well: Pushes a surface into the page. Good for input fields and code blocks.
  • Focus ring: A spread-only shadow, which is how you get a ring without changing layout.
  • Pressed button: Almost nothing. The absence of shadow is what reads as pressed.
  • Layered depth: Four layers at increasing blur. Closer to how real light falls off.
  • Colored glow: Tint the shadow with the element's own hue instead of using grey.
  • Hard offset: Zero blur. A flat graphic look rather than a lighting effect.
  • Sticky header: Only visible once the page scrolls under it. Keep it subtle.

Performance notes

Shadows are cheap to render but not free. Very large blur values on elements that animate can cost frames on lower end devices. If you are animating, prefer transforming a separate shadow element or keep blur modest. For static layouts, layer freely.

Frequently asked questions

What does each box-shadow value mean?

A CSS shadow is offset X, offset Y, blur radius, spread radius and a color. Positive Y pushes the shadow down, blur softens the edge, and spread grows or shrinks the whole shadow before it blurs.

How do I layer multiple shadows?

The box-shadow property accepts a comma separated list. HueKit lets you add as many layers as you want, and stacks them in the same order, which is how designers build soft, realistic depth.

What is an inset shadow?

An inset shadow is drawn inside the element instead of behind it, which reads as a pressed or recessed surface. Toggle inset on any layer to switch it.

Why use low opacity colors for shadows?

Real shadows are soft and semi transparent. Stacking two or three low opacity layers, one tight and one wide, looks far more natural than a single hard shadow.

How do I use a custom box shadow in Tailwind CSS?

Copy the Tailwind line under the CSS. It wraps the exact value in an arbitrary value, shadow-[...], with every space written as an underscore, so it works in Tailwind v3 and v4 without a config change.

Can I edit a shadow I already have?

Yes. Paste it into the field under the controls: a bare value, a full box-shadow declaration or a Tailwind shadow-[...] class. Every layer loads into the editor with its offset, blur, spread, color and opacity.

Related tools

Last updated by FusionStudios. Every value on this page is computed by the same functions the tools use. How this is calculated.