svg-sprite-injector

Async load svg-sprites


Keywords
svg, sprite, injector, svgstore
License
MIT
Install
bower install svg-sprite-injector

Documentation

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