# conic-gradient()

> The `conic-gradient()` CSS function creates an image consisting of a progressive transition between two or more colors along a conical gradient.

## How do I make a pie chart with conic-gradient in CSS?

The function that creates a gradient that radiates from the center of a circle, resembling a pie chart. It allows creating complex, circular color transitions that can be used for backgrounds, charts or decorative elements.

- Topic: Background
- Type: function
- Browser support: Chrome 69+, Chrome Android 69+, Edge 79+, Firefox 83+, Firefox Android 83+, Safari 12.1+, Safari iOS 12.2+

## Example

Wrong:

```css
.pie {
  border-radius: 50%;
  background: conic-gradient(tomato, gold, teal);
}
```

Right:

```css
.pie {
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(
    tomato 0 40%, gold 40% 75%, teal 75% 100%
  );
}
```

Hard stops at shared positions turn a smooth color sweep into clear pie slices.

## Common mistakes

- Slices blend into each other because the stops are not doubled at the same angle.
- The chart starts from the wrong side; the gradient begins at the top unless `from` is set.

## Key points

- Pie slices use hard stops, where each color starts at the previous color's end.
- A round pie sets `border-radius: 50%` and equal width and height, or `aspect-ratio: 1`.
- Charts drawn with gradients have a text or ARIA alternative, since the gradient carries no data for screen readers.

## Interview questions

### Where does a conic gradient start?

At the top, going clockwise. Use `from <angle>` to rotate the start, for example `from 90deg`.

### conic-gradient vs radial-gradient?

A conic gradient changes color around a center point. A radial gradient changes color outward from the center.

## Related cards

- [repeating-conic-gradient()](https://wonderium.dev/css/repeating-conic-gradient.md)
- [radial-gradient()](https://wonderium.dev/css/radial-gradient.md)
- [border-radius](https://wonderium.dev/css/border-radius.md)
- [aspect-ratio](https://wonderium.dev/css/aspect-ratio.md)
- [Angle Units](https://wonderium.dev/css/angle-units.md)

---

- Level: [CSS](https://wonderium.dev/css.md)
- HTML version: https://wonderium.dev/css/conic-gradient
- Last updated: 2026-11-25
