3 ms·
I mean the outdated tutorials still suggest icon fonts. What’s a good alternative?
by charlieyu1 4y ago
I mean the outdated tutorials still suggest icon fonts. What’s a good alternative?
- c12 4y agoI sometimes use svg's define symbol method `<defs>` (https://developer.mozilla.org/en-US/docs/Web/SVG/Element/defs https://developer.mozilla.org/en-US/docs/Web/SVG/Element/def...), you combine all the icons you use into one document that you load with display none and then reference those symbols anywhere else on the page using svg `<use>`.
- termin4l 4y agoUse graphics for icons. For a11y reasons, include a text alternative, like the alt attribute on <img> elements or adding a <title> in your <svg>. https://css-tricks.com/accessible-svgs/ https://css-tricks.com/accessible-svgs/