Design

CSS Shadow Generator

Build box-shadow and text-shadow with sliders and live preview — including inset boxes, spread, and optional second text layer. Copy rgba() output that matches modern browsers. Everything runs locally; nothing is uploaded.

Ad placement — top banner
Shadow type
Box preview

Adjust sliders to see box-shadow.

The quick brown fox

%

Used for the main box or first text layer. Layer 2 uses its own color below when enabled.

Presets

CSS output


          
          
        
Ad placement — mid rectangle

What are CSS box-shadow and text-shadow?

box-shadow paints a shadow around an element’s border box — useful for cards, buttons, and elevation. You can set horizontal and vertical offset, blur radius, optional spread, color, and the inset keyword for inner shadows. text-shadow applies a shadow to glyph outlines; it does not include spread, and multiple comma‑separated shadows stack for glow and outline effects.

box-shadow vs filter: drop-shadow()

box-shadow follows the element’s rectangular box (respecting border-radius). The filter: drop-shadow() function follows the alpha shape of the content — better for irregular PNG/SVG silhouettes. This generator targets standard box-shadow and text-shadow only.

Opacity and rgba()

Shadows are often semi‑transparent black or tinted color. This tool outputs rgba() from your chosen color and opacity so you can paste values that match design tools and avoid washed‑out hex hacks.

Stacking and performance

Multiple box-shadow layers (comma‑separated) are valid but can increase paint cost on large, animating surfaces. Prefer a small number of well‑chosen layers; profile on low‑end devices when animating shadows.

How to use this tool

  1. Step 1: Choose Box or Text and adjust offsets, blur, spread (box only), and color.
  2. Step 2: For text, optionally enable a second layer with its own color for glow or outline-style effects.
  3. Step 3: Copy the generated CSS into your stylesheet or component.

Frequently Asked Questions

Does DroidXP upload my settings?

No. All sliders and previews run in your browser. Nothing is sent to our servers when you copy CSS.

Can I add multiple box-shadows in this UI?

This page edits a single box-shadow for clarity. For multiple layers, copy one result, then append comma‑separated shadows in your CSS (first layer paints on top).

Why does inset look wrong on my element?

Inset shadows appear inside the border box. If the element has no padding or visible background, the effect can be subtle. Try a contrasting background or increase blur and spread slightly.

Does text-shadow support spread?

The CSS text-shadow syntax has no spread radius (unlike box-shadow). Faking a thick outline requires multiple layered shadows or other techniques such as -webkit-text-stroke — not generated here.

Will shadows look identical in every browser?

Generally yes for standard syntax. Subpixel rounding, font rasterization, and subpixel antialiasing can make text-shadow differ slightly. Always check critical designs in your target browsers.

Should I animate box-shadow for hover effects?

Animating shadow blur and offset can be expensive. Alternatives include animating opacity on a pseudo‑element shadow layer or using transform for lift — profile before shipping.

What about focus outlines for accessibility?

Decorative shadows are not a substitute for visible :focus-visible styles. Keep keyboard focus indicators per WCAG; use shadows as enhancement, not the only focus cue.

Do shadows print?

Many browsers omit or simplify shadows in print. Do not rely on shadow for essential contrast in printed documents; set explicit colors and borders for print stylesheets if needed.

Is this a replacement for my design system?

No. Use it for quick experiments. Production products should document elevation levels, tokens, and tested shadow recipes in one place for consistency.