1.0.0 • Published 9 years ago

svg-sprite-injector v1.0.0

Weekly downloads
14
License
MIT
Repository
github
Last release
9 years ago

svg-sprite-injector

Async load svg-sprites

Inspired by http://osvaldas.info/caching-svg-sprite-in-localstorage

Usage

Just simply call

svgSpriteInjector('sprite.svg');

Cache by localStorage

svgSpriteInjector('sprite.svg', {
	revision: 1 // Revision identifier
});

Params in DOM

svgSpriteInjector(document.body);
<body data-svg-sprite="sprite.svg" data-svg-sprite-revision="1">
	<div></div>
</body>

Combine separated SVG's

For combine svg files into one with elements use gulp-svgstore or grunt-svgstore

License

The MIT License (MIT)

Copyright © 2015 Bogdan Chadkin