How do I do the rings in this design in CSS and/or JS?
The number of icons is dynamic.
- First icon is all grey
- Icons in-between a mix of grey and blue
- Last icon is a blue gradient
It is a requirement for the rings to be dynamic; not part of the image.

You can create pseudo-element (:before) in the background with extra height and width than the actual element. Then use
conic-gradientas background for that pseudo element.Check the below example:
For customization options, check the below CodePen link.
https://codepen.io/rohitutekar/pen/BadOgmg