Command Palette

Search for a command to run...

Developer Tool

CSS Gradient Generator

Create beautiful CSS gradients visually. Linear, radial, and conic gradients with live preview and code.

About CSS Gradient Generator

A CSS gradient generator creates linear, radial, and conic CSS gradients visually and provides the corresponding CSS code. CSS gradients are used extensively in modern web design for backgrounds, buttons, overlays, and decorative elements. Writing gradient code manually requires understanding multiple functions and their syntax — this tool makes it visual and intuitive by letting you drag control points, adjust colors, and see the result in real-time.

How to Use

Choose the gradient type (linear, radial, or conic). Add color stops by clicking on the gradient preview or using the color picker. Drag color stops to adjust their position. Set the angle for linear gradients or the position/shape for radial gradients. The generated CSS code updates in real-time and can be copied directly into your stylesheet.

Formula / Key Equations

Linear gradient: background: linear-gradient(angle, color-stop1, color-stop2, ...). Radial gradient: background: radial-gradient(shape size at position, color-stop1, color-stop2, ...). Conic gradient: background: conic-gradient(from angle at position, color-stop1, color-stop2, ...). Color stop format: color position (e.g., #ff0000 30%).

Common Use Cases

Creating visually appealing website backgrounds. Designing modern button hover effects with gradient transitions. Building overlay effects for hero sections and cards. Creating progress bars and loading indicators. Designing decorative elements and dividers. Prototyping UI designs with rich gradient backgrounds.

Limitations

Generated CSS may not include all vendor prefixes needed for older browsers. Some complex gradient patterns require repeating-gradient functions or multiple background layers. Very complex gradients with many color stops may have performance implications on lower-end devices. Print rendering of CSS gradients varies between browsers.

Frequently Asked Questions

What types of CSS gradients are available?

There are three main types: linear (color transitions along a straight line), radial (color transitions from a center point outward), and conic (color transitions around a center point, like a color wheel). Each type has its own syntax and use cases.

How do I make a gradient transparent?

Add a color stop with rgba() using alpha 0, or use the transparent keyword. For example: linear-gradient(to right, #ff0000, transparent) fades from red to fully transparent. You can also use rgba(255, 0, 0, 0) for the same effect.

Can I animate CSS gradients?

Basic gradient animation is limited in CSS. You cannot directly animate gradient stops, but you can work around this by: animating background-position with a larger gradient, using @property to animate custom properties (in supporting browsers), or using pseudo-elements with opacity transitions.

What is the difference between linear-gradient and repeating-linear-gradient?

linear-gradient transitions once from the first to last color stop. repeating-linear-gradient repeats the pattern infinitely. This is useful for creating stripes, repeating patterns, and angled backgrounds that tile seamlessly.

How do I add multiple gradient layers?

You can stack multiple gradients using comma-separated values in the background property: background: linear-gradient(...), radial-gradient(...). Each gradient becomes a layer, with the first one on top. This technique creates complex visual effects.

Related Tools