svg-sprite-injector

Async load svg-sprites

MIT License

Downloads
228
Stars
16
Committers
3

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