This repo contains a SVG sprite version of the Octicons
(v.10.0.0) generated with the provided svg-sprite-maker.js
NodeJS script.
Declare a <svg>
tag and simply <use>
the desired icon. For example, using the
"project-24" icon is achieved with the following:
<svg>
<use xlink:href="octicons-sprite.svg#project-24"></use>
</svg>
Note that most browsers block cross-origin requests for the <use>
tag, so you
should probably host your own copy of the sprite file.
Use the provided svg-sprite-maker.js
:
node ./svg-sprite-maker.js /path/to/svg/directory > output-sprite.svg