svg-inject
Replace an <img>
element with an inline SVG. This way you can still earn
the benefits of not inlining every occurence of an SVG, but still style
their contents using CSS selectors. This makes adding hover states and the like
much more straightforward :)
Usage
inject(element, [callback])
Replace the <img>
element
with an SVG, calling callback(err, svg)
when
complete.
// Replaces all existing SVG images on the DOM with inline SVGs:var inject =var svgs = documentfor var i = 0; i < svgslength; i++
See Also
License
MIT. See LICENSE.md for details.