Reputation: 2350
I'm currently working on a site for a client that is using this library quite a bit to inject SVGs into each page: https://github.com/iconic/SVGInjector
Most pages on this site include 15+ SVG icons used as icons and I'm trying to minimize the number of requests which injecting doesn't remedy.
I'm considering including these SVGs as inline elements to reduce the number of HTTP requests on each page but I don't understand what the purpose of injecting is over just inlining them to start with. What am I missing?
Thank you!
Upvotes: 2
Views: 128
Reputation: 7735
Using inline SVG is necessary for some reasons the library README mentions:
On the other hand, using inline SVG is bad for other [arguable] reasons:
The library you mention solves these problems by allowing you to store the SVGs in different files, yet be able to use them inline.
Upvotes: 3