super-svg
v1.0.2
Published
A simple, unobtrusive and helpful plugin to load SVG icons and spritesheets.
Downloads
16
Maintainers
Readme
Super SVG
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.
How super?
@todo
Usage
Step 1
Include jQuery (but you knew that already).
Step 2
Include the plugin:
<script src="dist/jquery.super-svg.min.js"></script>Step 3
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;Step 4
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>Contributing
Check CONTRIBUTING.md for more information.
License
MIT License © David Bonner
