5 ms·
What's wrong with having the SVG embedded in the HTML? Someone who knows more about the inner workings of network technologies can correct me if I'm wrong, but
by hbn 4y ago
What's wrong with having the SVG embedded in the HTML?
Someone who knows more about the inner workings of network technologies can correct me if I'm wrong, but I would have figured it's better to send a single large file than a bunch of smaller files.
- SuperCuber 4y agoApparently HTTP2 makes multiple small files much less of a performance issue (or maybe even turns it into a performance gain, I haven't looked into it too closely)
- djfobbz 4y agoSee example here: https://imgur.com/a/XMEkAu1 https://imgur.com/a/XMEkAu1 it's 28 lines total...1 button + 2 svg images, should total 6 lines of code tops! This is my frustration and this is what I call SVG pollution.
- hbn 4y agoIt's 28 lines because it's formatted to have every attribute on a different line. I'd put the <svg> tag and all its attributes on a line, the entirety of the path on a single line, and then with the closing </svg> tag it's reduced to 3 lines. This is how I do embedded SVGs: https://imgur.com/a/zVVEVps https://imgur.com/a/zVVEVps Note your example also looks way worse because of line wrap