This content originally appeared on Bram.us and was authored by Bramus!
Good reminder by Georgi Nikoloff to have one (visually hidden) SVG that contains several layers, which you can then include further down in your code.
SVG has a
<defs>
tag that lets us declare something like our graph footer just once and then simply reference it — using<use>
— from anywhere on the page to render it as many times as we want.
That way you end up with less DOM nodes, less bytes transferred, and less memory consumed.
Too Many SVGs Clogging Up Your Markup? Try use
→
This content originally appeared on Bram.us and was authored by Bramus!
Bramus! | Sciencx (2021-03-16T22:51:09+00:00) Too Many SVGs Clogging Up Your Markup? Try use. Retrieved from https://www.scien.cx/2021/03/16/too-many-svgs-clogging-up-your-markup-try-use-2/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.