π What Is repeating-conic-gradient()?
The repeating-conic-gradient() function creates a **circular repeating pattern** by rotating colors around a center point. Unlike conic-gradient(), which creates a single sweep, this version keeps repeating the pattern infinitely.
Note
β Repeats angular segments automatically
β Great for circular textures and loaders
π¦ Syntax
Basic Syntax
repeating-conic-gradient(from angle at position, color-stop1, color-stop2, ...);Optional parts:
- from angle β start rotation angle
- at position β center position
π 1. Basic Repeating Conic Pattern
Simple stripes
background: repeating-conic-gradient(
red 0deg 20deg,
yellow 20deg 40deg
);Creates alternating red-yellow slices repeating around the circle.
π 2. Checkerboard Wheel Pattern
Checker wheel
background: repeating-conic-gradient(
black 0deg 15deg,
white 15deg 30deg
);Produces a wheel-style checkerboard pattern.
π 3. Multi-Color Repeating Wheel
Colorful wheel
background: repeating-conic-gradient(
red 0deg 10deg,
orange 10deg 20deg,
yellow 20deg 30deg,
green 30deg 40deg
);A vibrant circular multi-slice pattern.
π 4. Creating a Spiral-Like Effect
Spiral illusion
background: repeating-conic-gradient(
from 10deg,
#000 0deg 10deg,
#fff 10deg 20deg
);Offsetting the start angle creates a subtle spiral motion.
π 5. Positioning the Gradient Center
Custom center
background: repeating-conic-gradient(
at 30% 60%,
teal 0 20deg,
lightblue 20deg 40deg
);Moves the center of the pattern for asymmetrical artwork.
π 6. Thin Repeating Lines (Circular Stripes)
Thin lines
background: repeating-conic-gradient(
rgba(0,0,0,0.6) 0 2deg,
transparent 2deg 6deg
);Creates a subtle circular textured pattern.
π 7. Radar or Sonar Scan Effect
Radar pattern
background: repeating-conic-gradient(
rgba(0,255,0,0.5) 0deg 3deg,
transparent 3deg 20deg
);Ideal for dashboards or special effects.
π 8. Repeating Conic for Mandala/Art
Mandala effect
background: repeating-conic-gradient(
purple 0 10deg,
pink 10deg 20deg,
orange 20deg 30deg,
yellow 30deg 40deg
);Rotational repetition gives a beautiful mandala-like geometry.
π 9. Animated Spinning Pattern
Spinner animation
.spinner {
width: 120px;
height: 120px;
border-radius: 50%;
background: repeating-conic-gradient(
black 0 10deg,
white 10deg 20deg
);
animation: spin 2s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}Creates a rotating fan or hypnotic loading animation.
π 10. Donut Pattern (Using Mask)
Donut pattern
.donut {
width: 200px;
height: 200px;
border-radius: 50%;
background: repeating-conic-gradient(
#ff5252 0 30deg,
#ffd740 30deg 60deg
);
mask: radial-gradient(circle, transparent 40%, black 41%);
}Creates hollow circular repeating patterns for unique UI shapes.
π§ͺ Real-World Examples
1οΈβ£ Decorative Background Texture
Decor background
background: repeating-conic-gradient(
#eee 0 10deg,
#ddd 10deg 20deg
);2οΈβ£ Circular Heatmap Effects
Heatmap-style
background: repeating-conic-gradient(
red 0 45deg,
yellow 45deg 90deg,
green 90deg 135deg,
blue 135deg 180deg
);3οΈβ£ Fancy Button Hover Background
Hover effect
button:hover {
background: repeating-conic-gradient(
royalblue 0 15deg,
white 15deg 30deg
);
}β οΈ Common Mistakes
- β Forgetting to define angle lengths (patterns become huge)
- β Using excessively small angle steps β heavy rendering
- β Expecting smooth radial fades (use radial-gradient())
- β Leaving gap ranges incorrectly (visible seams)
Note
π₯ Summary
The repeating-conic-gradient() function creates beautiful, circular, repeating patterns perfect for artistic UI, dashboards, charts, loaders, and textures. By controlling angles, colors, and center position, you can create endless geometric effects without images.
Learn more βMDN Docs π