Svg sprite from Illustrator (with separate viewBox for each element)?

Is there a way to export an .svg sprite directly from Illustrator, with a separate viewBox for each element?

I am only able get one viewBox for the whole set of icons, even when each of them is on its own artboard.

Answer

I seem to have found the solution – each sprite element must be converted to a symbol. That creates a viewBox for each symbol when exporting the svg.

An example:

<symbol id="badminton" data-name="badminton" viewBox="0 0 33.84 40.41">

Attribution
Source : Link , Question Author : Ilze , Answer Author : Ilze

Leave a Comment