TFT

CSS Gradient Generator

Create beautiful linear, radial, and conic gradients with live preview. Generate production-ready CSS code instantly.

Gradient Settings
0°90°180°270°360°
Color Stops
Live Preview
Generated CSS
linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%)
.gradient { background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%); }
Quick Presets

What This Tool Does

CSS gradients replace background images with code. You pick colors, adjust the angle or shape, and get the CSS to paste into your stylesheet. No Photoshop, no export, no 500KB PNGs.

This generator covers all three gradient types: linear (straight transitions), radial (circular spread from a center point), and conic (rotating around a center, like a pie chart). Each has its use - linear for buttons and cards, radial for spotlights and depth, conic for charts and color wheels.

When Gradients Actually Help

Call-to-action buttons

A subtle gradient makes buttons pop without looking gimmicky. Try a 2-3% lightness shift at a 45-degree angle.

Hero section backgrounds

Gradients create visual interest without the performance hit of large images. Layer multiple gradients for complexity.

Loading states and progress bars

Animated gradients signal activity. Use conic gradients for circular loaders, linear for progress bars.

Card and section dividers

A soft gradient background separates content areas more elegantly than hard borders or solid colors.

Gradient Syntax, Explained

Linear gradients

linear-gradient(135deg, #667eea 0%, #764ba2 100%)

The angle controls direction. 0deg goes up, 90deg goes right, 180deg goes down. Color stops define where each color hits 100% opacity.

Radial gradients

radial-gradient(circle, #667eea 0%, #764ba2 100%)

Shape can be "circle" or "ellipse". The gradient spreads from the center outward. You can also set a specific center point with "at 50% 50%".

Conic gradients

conic-gradient(from 0deg, #667eea 0%, #764ba2 50%, #667eea 100%)

Conic gradients rotate around a center. "from 0deg" starts at the top. Great for pie charts - each slice is a color stop with specific start and end positions.

Common Questions

How many color stops should I use?

Two to four colors usually works best. More than that and gradients start looking muddy. If you need complex blends, consider layering multiple gradients instead of adding more stops.

Can I use transparency?

Yes - use rgba() or hsla() values. Transparent gradients work well for overlays. Example: rgba(0, 0, 0, 0.4) for a dark overlay.

Do gradients affect performance?

Not noticeably. Gradients are GPU-accelerated and render faster than loading images. The only concern is animating gradients, which can trigger repaints.

Why does my gradient look banded?

Color banding happens when there aren't enough intermediate colors. Add a tiny amount of noise with a pseudo-element, or use more color stops to smooth the transition.

Tips That Actually Help

1

Subtle beats obvious

A 5% lightness shift looks professional. Rainbow gradients look like 2005 called.

2

Match your brand colors

Use your primary color as the base, then shift hue slightly for the second stop.

3

Test in grayscale

If the gradient disappears in grayscale, the colors are too similar in lightness.