CSS gradient generator

Pick two or three colors and an angle to build a CSS gradient, then copy the code.

Gradient syntax

linear-gradient(90deg, #e11d48, #2563eb)
radial-gradient(circle, #e11d48, #2563eb)
conic-gradient(from 0deg, #e11d48, #f59e0b, #2563eb)

Angles: 0deg points up, 90deg to the right, 180deg down. Add positions to control where colors change: linear-gradient(90deg, red 0%, red 50%, blue 50%) gives a hard edge.

Avoiding muddy middles

Gradients between complementary colors (red → green, blue → orange) pass through gray in sRGB. Add a bright middle color, or in modern browsers interpolate in OKLCH: linear-gradient(in oklch 90deg, …).

Frequently asked questions

Do I need a fallback color?
All current browsers support gradients, but a solid background line first is harmless and helps if the gradient fails to parse.
Can gradients be animated?
Gradients themselves do not transition smoothly; animate background-position on an oversized gradient, or register custom properties with @property.