N.B. This plugin is very much in it's infancy and was put together to handle my personal needs with a project. Both tests and build scripts are coming soon. A CSS stylesheet will be included shortly as well.
@todo
Include jQuery (but you knew that already).
Include the plugin:
<script src="dist/jquery.super-svg.min.js"></script>
Set the path to the SVG sprite sheet. Sprite sheets can be generated at https://icomoon.io/ or put together manually.
// 'window.$svgpath' can be a string
$.fn.svgIcon.options.path = window.$svgpath;
Use [data-icon="svg-id"]
to initialise the icons. The data-icon
attribute takes the ID associated with the symbol within the SVG document.
<span class="my-icon-class" data-icon="star"></span>
Check CONTRIBUTING.md for more information.
MIT License © David Bonner