FAQ

A CSS conic gradient rotates colors around a center point at specified angles (0-360°), like clock hands sweeping around a circle. Created with conic-gradient(), it differs from linear gradients (transition along a line) and radial gradients (transition from center outward). Conic gradients change color by angle, not distance from center. Syntax: background: conic-gradient(red 0deg, blue 180deg, red 360deg);. Primary uses: pie charts, color wheels, progress indicators, and loading spinners.
Use conic-gradient() with hard color stops: background: conic-gradient(red 0% 33%, blue 33% 66%, green 66% 100%); creates 3 equal segments. Must include border-radius: 50% to make element circular. Convert percentages to degrees (multiply by 3.6): 25% = 90°, 50% = 180°, 75% = 270°. Add from -90deg to start from top instead of right. Example: .pie { width: 200px; height: 200px; border-radius: 50%; background: conic-gradient(from -90deg, red 0% 40%, blue 40% 100%); }
Browser support: Chrome 69+ (Sept 2018), Firefox 83+ (Nov 2020), Safari 12.1+ (March 2019), Edge 79+, Opera 56+. Covers 95%+ of global users (as of 2026). No IE11 support. For older browsers, provide fallback: background: #3498db; background: conic-gradient(...); (older browsers use solid color, modern browsers use gradient). Or use @supports (background: conic-gradient(red, blue)) { ... } for feature detection. Mobile: Full support on iOS 12.2+, Android Chrome 69+.
Linear: Colors change by position along a line. linear-gradient(90deg, red, blue) = red left, blue right. Radial: Colors change by distance from center point. radial-gradient(circle, red, blue) = red center, blue edge. Creates concentric rings. Conic: Colors change by angle around center. conic-gradient(red 0deg, blue 180deg) = red top, blue bottom. Creates pie slices. Key difference: conic uses angle (0-360°), radial uses radius distance, linear uses position along line.
Yes, but not directly. Cannot animate gradient property itself (performance issue). Three methods: (1) Animate transform: rotate() for spinning effects: @keyframes spin { to { transform: rotate(360deg); } }. (2) Use CSS variables for progress: background: conic-gradient(blue 0% var(--progress)); then transition: --progress 0.3s;. (3) Animate opacity of layered gradients. Best performance: transform animations (GPU-accelerated). Avoid: changing gradient color stops directly (triggers expensive recalculation).
Use HSL colors in conic gradient: background: conic-gradient(hsl(0, 100%, 50%), hsl(60, 100%, 50%), hsl(120, 100%, 50%), hsl(180, 100%, 50%), hsl(240, 100%, 50%), hsl(300, 100%, 50%), hsl(360, 100%, 50%));. Add border-radius: 50% for circular shape. HSL hue (0-360) maps directly to gradient angles—no conversion needed. Full code: .wheel { width: 300px; height: 300px; border-radius: 50%; background: conic-gradient(...); }. For interactive picker, layer radial gradient for saturation control.
Add from -90deg to rotate starting point to top. Default 0° points right (3 o'clock). Subtracting 90° moves it to top (12 o'clock). Example: background: conic-gradient(from -90deg, blue 0% 75%, gray 75% 100%);. Without "from -90deg", progress/pie charts start from right side—confusing for users who expect top start. All progress indicators should use from -90deg for intuitive clockwise fill from top.
(1) Pie/donut charts: Show data percentages without Chart.js—pure CSS, instant render. (2) Progress indicators: Circular task completion gauges (0-100%). (3) Color pickers: Hue/saturation selectors like Photoshop. (4) Loading spinners: Animated gradient trails (iOS-style). (5) Dashboard widgets: Analytics percentage breakdowns. (6) Clock interfaces: Time segments with colored zones. (7) Decorative backgrounds: Starburst/radial patterns. Replaces JavaScript charting libraries with single CSS property.