Convert SVG Colors to CSS Variables

Map hex fills to var(--svg-c1) tokens on the root

Strip inline styles? Strip inline stylesFill color with CSS? Fill color with CSS

FAQ

Quick answers

How do I convert SVG colors to CSS variables?
Click Convert to CSS variables. Unique hex fills become --svg-c1, --svg-c2 on the root, and shapes use var(--svg-cN).
How is this different from a CSS fill class?
Variables keep multiple colors. A single CSS fill class forces one fill. Use Fill Color With CSS for a one-class theme.
Can I edit the tokens after conversion?
Yes. Change --svg-c1 on the root style or in a parent stylesheet.
Are stroke colors converted too?
Yes when they are hex/rgb. none and url() paints are left alone.
Strip inline styles → Fill color with CSS → Fill on hover → Monochrome icon →
Open full editor →

Source

Type or paste SVG markup. The preview on the right updates as you type.

Ready

Live preview

PNG export · 2× for retina