Search tools

Color guides

CSS conic-gradient(): Pie Charts, Progress Rings & Seam Fixes

Build zero-SVG pie charts, masked donut progress rings, and smooth 360-degree color wheels with CSS conic-gradient(). Fix jagged slice edges and 0deg seams.

3D studio render on warm alabaster showing a continuous iridescent optical glass torus surrounding a three-wedge matte teal, amber, and terracotta ceramic donut ring

A CSS conic-gradient() sweeps color stops clockwise around a center point, starting at 12 o’clock (0deg) instead of running along a line or radiating outward. That single geometry change lets you build pie charts, circular progress rings, and color wheels in a few lines of CSS with zero SVG or charting libraries.

Here is a ready-to-use 72% circular progress ring whose center stays truly transparent over any light or dark card:

.progress-ring {
  width: 120px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(#2f6f68 0% 72%, #e6e2d9 72.3% 100%);
  mask: radial-gradient(farthest-side, transparent calc(100% - 14px), #000 calc(100% - 13px));
}

You can experiment with conic angles, custom stops, and OKLab interpolation interactively in our CSS gradient generator.

Build a CSS pie chart and hollow donut ring

To create crisp slices instead of smooth fades, give each color both a start and an end percentage. Pairing a slice’s end with the next slice’s start creates a clean radial boundary:

.pie-chart {
  width: 180px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(
    #2f6f68 0% 54.7%,
    #f2b134 55% 82.7%,
    #c05746 83% 100%
  );
}

Most tutorials turn a pie chart into a donut chart by dropping a white circle <div> on top. That breaks the moment you place the chart on a tinted surface or dark theme.

Using mask: radial-gradient(farthest-side, transparent calc(100% - 14px), #000 calc(100% - 13px)) punches a real transparent cutout in the element. The 1px step between 14px and 13px keeps the inner edge anti-aliased and razor-sharp.

css-conic-gradient-pie-charts-progress-rings-diagram

Fix the two classic conic-gradient bugs

1. The harsh vertical seam at 12 o’clock (0deg)

If you write conic-gradient(#2f6f68, #f2b134, #c05746), the browser starts with teal at 0deg and ends with terracotta at 360deg. Where those two edges meet at 12 o’clock, you get an abrupt vertical cut.

Repeat the opening color at the end (100%) so the gradient wraps smoothly, or let OKLCH sweep all 360 degrees from a single starting hue:

/* Closed 3-color loop with zero seam at 12 o'clock */
.wheel-loop {
  background: conic-gradient(in oklab, #2f6f68, #f2b134, #c05746, #2f6f68);
}

/* Full 360-degree perceptual color wheel from one hue */
.color-wheel {
  background: conic-gradient(in oklch longer hue, oklch(66% 0.14 185), oklch(66% 0.14 185));
}

2. Jagged stair-step edges between hard slices

When two pie slices meet at the exact same stop (55% and 55%), standard monitors render noticeable pixel stair-stepping along diagonal cuts. Adding a tiny 0.3% (roughly 1deg) gap between stops (54.7% to 55%) lets the browser blend one anti-aliased pixel across the seam without looking blurry.

Watch out for the CSS Images 4 comma trap

When you combine a starting rotation (from 90deg) with a perceptual color space (in oklab or in oklch), do not put a comma between them. Both belong to a single whitespace-separated prelude before the first comma:

/* INVALID: extra comma after 90deg makes browsers drop the whole declaration */
background: conic-gradient(from 90deg, in oklab, #2f6f68, #f2b134, #2f6f68);

/* VALID: space-separated prelude, single comma before color stops */
background: conic-gradient(from 90deg in oklab, #2f6f68, #f2b134, #2f6f68);
Gradient Type Direction Geometry Best UI Job
linear-gradient() Straight line (135deg, to right) Hero banners, buttons, surface sheen
radial-gradient() Outward from focal center Spotlights, glows, donut masks
conic-gradient() Clockwise around center (0deg to 360deg) Pie charts, progress rings, color wheels, metallic dials

Not sure when to use linear or radial instead? Read our guide on linear vs radial gradients in UI design, and see why OKLab fixes muddy gray bands in CSS gradients.

CSS conic-gradient() FAQ

How do I animate a conic-gradient progress ring smoothly?

Browsers cannot interpolate raw background-image strings directly. Register a typed CSS custom property with @property so CSS transitions the percentage stop cleanly:

@property --pct {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 0%;
}

.ring {
  background: conic-gradient(#2f6f68 var(--pct), #e6e2d9 0);
  transition: --pct 400ms ease;
}

Can I move the center point of a conic gradient?

Yes. Add at <x> <y> inside the prelude before the comma, such as conic-gradient(from 45deg at 25% 75%, #2f6f68, #f2b134, #2f6f68).

Do all modern browsers support CSS conic-gradient()?

Yes. Chrome 69+, Safari 12.1+, Firefox 83+, and Edge 79+ all support conic-gradient() natively. For older browsers that do not parse in oklab, add a plain sRGB stop list right before the perceptual line as a cascade fallback.

Build linear, radial, and conic CSS gradients with live OKLab interpolation and sRGB fallbacks in the ToolQuilt CSS gradient generator.

Read next