3 ms·
I think using a single SVG document that contains multiple icons identified by ids which you can reference from HTML is the idiomatic way of solving your proble
by mariusor 3y ago
I think using a single SVG document that contains multiple icons identified by ids which you can reference from HTML is the idiomatic way of solving your problem. It guarantees that if external resources are not permitted to load, at least it presents a human readable title instead of a random letter.
I can't find a link to the reference CSS Tricks article that presented the technique, but you can see it in action on this website: https://brutalinks.tech https://brutalinks.tech (There's an icon document: which is referred in the HTML when the icons are loaded: <svg><use xlink:href="https://brutalinks.tech/icons.svg#icon-home https://brutalinks.tech/icons.svg#icon-home "><title>home</title></use></svg>)
- hannes0 3y agoThanks! The reason why I asked for a font is that Wordpress still does not support natively SVG, but custom fonts. Still, very interesting how brutalinks.tech implemented this. Didn't know about this method, thanks!