top | item 36849736

(no title)

hannes0 | 2 years ago

Maybe this is a good place to ask: Does anybody know a good resource for icons, but bundles as a font (e.g. woff2)?

discuss

order

mariusor|2 years 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 (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 "><title>home</title></use></svg>)

hannes0|2 years ago

Thanks! 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!