Linear, Radial, and Conic: Understanding Gradient Geometries
- • CSS gradients are procedural image generators defined mathematically by the browser engine:
- • linear-gradient(angle, stops): Interpolates colors along a straight directional axis.
- • radial-gradient(shape at position, stops): Radiates colors outward from an origin point in circular or elliptical patterns.
- • conic-gradient(from angle at position, stops): Sweeps colors in a 360-degree rotation around a center point, essential for color wheels, pie charts, and animated border beams.
/* CSS Gradient Geometry Examples */
.linear {
background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
}
.radial {
background: radial-gradient(circle at 50% 50%, #3b82f6 0%, #090a0f 70%);
}
.conic {
background: conic-gradient(from 0deg at 50% 50%, #6366f1, #10b981, #f59e0b, #6366f1);
}