Skip to content

S[pan]VG – load up your SVG icons and images with a simple <span>

License

Notifications You must be signed in to change notification settings

davidianbonner/super-svg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

S[pan]VG – load up your SVG icons and images with a simple <span>

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published