Convert SVG Attributes to CSS Classes

Group identical fill/stroke pairs into shared class names

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

FAQ

Quick answers

How do SVG attributes become shared CSS classes?
Click Convert to CSS classes. Shapes with the same fill/stroke share a class; the rule lives in <style>.
How is this different from attrs → CSS on unique shapes?
Attrs → CSS always emits classes. This page stresses sharing: two blue rects become one class, not two.
Does converting to classes change geometry?
No. Only paint attributes move into CSS.
Can I strip leftover presentation attributes after classing?
The convert pass already removes the moved fill/stroke attributes from the elements.
Strip inline styles → Fill color with CSS → Colors → CSS variables → Fill on hover →
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