Iconscout / unicons

Unicons by IconScout offers 7,000+ free 3D and animated icons plus icon fonts in line, monochrome, solid and thin line styles. Use them in your web, iOS or Android design projects.
https://iconscout.com/unicons
Other
1.42k stars 98 forks source link

SVG sprite? #6

Closed pggalaviz closed 5 years ago

pggalaviz commented 5 years ago

Have you guys considered providing a SVG sprite (no font)? Thanks for the amazing set.

tarunmangukiya commented 5 years ago

Are you looking for this? https://github.com/Iconscout/unicons/blob/master/font/unicons.svg

pggalaviz commented 5 years ago

No, that's a font not a sprite.

An icon inside a sprite looks something like this:

<symbol id="angle-left" viewBox="0 0 512 512">
  <path d="m241 256l75-76c8-8 8-21 0-29-8-9-21-9-30 0l-90 90c-5 4-7 9-7 15 0 6 2 11 7 15l90 91c4 4 10 7 15 7 6 0 11-2 15-7 8-8 8-21 0-29z"/>
</symbol>

So I can use it inside my HTML like this:

<svg class="icon" >
  <use xlink:href="THE_SPRITE_FILE.svg#angle-left"></use>
</svg>
tarunmangukiya commented 5 years ago

Hi @pggalaviz,

Will you be able to write a build script for it? You can look at build folder for reference! :) There are SVGs in svg folder which will be updated once we release new icons, thus Sprite will be automatically generated!

tarunmangukiya commented 5 years ago

@antonreshetov any help here?

sarsamurmu commented 5 years ago

Hope it Helps https://github.com/Iconscout/unicons/pull/15

tarunmangukiya commented 5 years ago

Hi @pggalaviz,

We've added SVG Sprite option! Let me know if you face any issue. Thanks to @sarsamurmu