Skip to main content

CSS Gradient & Box Shadow Generator

Create CSS gradients and box shadows, including inset shadows, with a live preview, then copy the CSS into your project. Runs in your browser.

CSS

Shortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)

CSS Gradient and Box-shadow Generator

Build polished gradients and box shadows visually, preview the result live, and copy production-ready CSS without leaving your browser. It helps frontend developers prototype polished surfaces, backgrounds, and depth effects without hand-tuning every CSS value.

What this tool does and who uses it

This turns slider/color-picker adjustments into a copyable CSS background or box-shadow declaration, with a live preview. Two concrete uses: a frontend developer prototyping a button or card's hover-state shadow depth without round-tripping through a stylesheet edit-reload cycle, and a designer-developer pair agreeing on an exact gradient angle and color pair by adjusting it live together before it goes into code.

Worked example

The default gradient settings (linear, 135deg, #2563eb to #14b8a6) produce background: linear-gradient(135deg, #2563eb 0%, #14b8a6 100%);. The default shadow settings (0px, 12px, 24px blur, 0px spread, #0f172a66) produce box-shadow: 0px 12px 24px 0px #0f172a66;.

Common mistakes and edge cases

  • Switching to Radial doesn't use the angle slider at all — radial gradients here are always a fixed centered circle, only the two colors change.
  • Both gradient types always use exactly two color stops, fixed at 0% and 100% — there's no control to add a third color or reposition a stop. Edit the copied CSS by hand for anything more complex.
  • The shadow color field accepts an 8-digit hex value (like the default #0f172a66) for built-in alpha transparency — if you paste a plain 6-digit hex here expecting a semi-transparent shadow, it will render fully opaque instead.

Keep effects accessible

Use sufficient text contrast over gradients, avoid relying on shadow alone to communicate state, and test the effect against the actual page background and responsive layout.

Frequently asked questions

Does this generator send my CSS anywhere?
No. Every control and preview runs locally in your browser, and no generated CSS is stored or uploaded.
What gradient types are supported?
Linear and radial, with editable start/end colors. Linear gradients also let you set the angle; radial gradients are always a fixed centered circle with no angle, size, or position controls. Stop positions are fixed at 0% and 100% for both — there’s no control to add a third color or move a stop.
Can I make inset box shadows?
Yes. Toggle inset to place the shadow inside the preview element instead of outside its edges.
Can I use more than two colors in a gradient?
Not with this tool — it always generates exactly two color stops (start and end). For a 3+ color gradient, write the extra color-stop syntax by hand into the copied CSS.
How do I create a CSS linear gradient or box shadow?
Choose gradient or shadow, set the colours and positions, and copy the CSS. For a box shadow, small offsets with a soft blur look natural; very dark, hard shadows look heavy. Check the text contrast on top of a gradient, and keep animations gentle for people who prefer less motion.

Related tools

More Frontend & Design

View all Frontend & Design tools →