I've found pretty nice "percent pie chart" and want to create it with CSS only. No animation is required. Just static "picture".
I understand If I wanna create this kind of chart I need to use elements like these
The questions are
- How to create element #2 ?
- How to manage shape of element #2 for smaller (5%) or higher percent (80%) values ?
Using the new conic gradient, this can be managed with a single div which just landed in Chrome as an experimental property.
Image of Result
With thanks for Temani Afif it's possible to achieve this without the pseudo element using a border and leveraging
background-clip
...You can do this with multiple background.
From
0%
to50%
:From
50%
to100%
:You can combine both like this: