Design linear and radial CSS gradients. Add multiple color stops, adjust angles, and export ready CSS code.
CSS gradients are mathematically defined color transitions that replace traditional image files for background effects, overlays, buttons, and decorative elements. Unlike raster images, CSS gradients scale perfectly at any resolution, require no HTTP requests, and can be animated smoothly using CSS transitions or keyframe animations. Modern browsers support three gradient types natively: linear-gradient(), radial-gradient(), and conic-gradient().
This visual gradient editor generates standards-compliant CSS gradient syntax for all three types, with support for multiple color stops, arbitrary color formats (hex, HSL, RGB, named colors), angle control, and vendor-prefix generation for legacy browser compatibility. The live preview updates as you adjust parameters, and the generated CSS code is ready to paste directly into your stylesheet.
Linear gradients transition colors along a straight line defined by an angle (0deg=bottom-to-top, 90deg=left-to-right) or keyword direction (to right, to bottom right). Color stops position specific colors at percentage or length positions along the gradient axis: linear-gradient(45deg, #ff6b35 0%, #f7c59f 50%, #efefef 100%). Hard stops (placing two colors at the same position) create sharp color boundaries.
Repeating linear gradients tile the gradient pattern: repeating-linear-gradient(45deg, black 0px, black 10px, white 10px, white 20px) creates diagonal stripes. This technique replaces complex CSS patterns that previously required SVG or background images. Combining multiple gradient layers using comma separation creates complex multi-stop patterns including checkerboards, polka dots, and grid overlays.
Radial gradients radiate outward from a center point in circular or elliptical shapes. The radial-gradient(circle at 30% 70%, #667eea, #764ba2) syntax defines center position and shape separately. Radial gradients excel for spotlight effects, button glows, depth shading, and circular progress indicators.
Conic gradients (supported in all modern browsers since 2021) rotate color stops around a center point, progressing angularly rather than linearly or radially. conic-gradient(from 90deg, red, yellow, green, red) creates pie-chart-like color wheels. Conic gradients enable pure CSS pie charts, color wheels, angle dials, and the popular "color picker" aesthetic in design tools.
background: linear-gradient(direction, color-stop1, color-stop2, ...); Direction can be an angle (45deg) or keyword (to right, to bottom left). Example: background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); This creates a diagonal gradient from purple-blue to darker purple. Color stops can use any CSS color format including hex, rgb(), hsl(), or named colors.
Place two color stops at the same percentage position to create a hard boundary with no transition: linear-gradient(to right, red 50%, blue 50%). This produces a sharp red-to-blue split at the exact midpoint with no gradient blend. You can create striped patterns by alternating colors: linear-gradient(to right, red 25%, blue 25%, blue 50%, red 50%, red 75%, blue 75%).
CSS gradients themselves cannot be transitioned with CSS transition properties because gradient is not a transitionable property. However, you can animate gradients by: using CSS custom properties (variables) with transition and animating the variable values, using background-position animation on repeating gradients, or using @keyframes with opacity crossfades between gradient layers. JavaScript-driven animation via requestAnimationFrame is the most flexible approach.
Conic gradients rotate color stops around a center point (like a pie chart) rather than transitioning linearly across a line. Use conic-gradient for pie charts (pure CSS), donut charts, color wheels, angle indicators, and the popular spinning loader effect. Syntax: conic-gradient(from 0deg, red 0%, yellow 33%, green 66%, red 100%).
'to bottom' and '180deg' are equivalent — both describe a top-to-bottom gradient. The keyword system: 'to right'=90deg, 'to bottom'=180deg, 'to left'=270deg, 'to top'=0deg. Diagonal keywords: 'to bottom right'=135deg approximately. The angle system gives precise control: 45deg tilts the gradient from lower-left to upper-right. Angles increase clockwise from the top (like compass bearings).