News for hackers. Stuff that matters.
Re:Blocking web fonts for speed and privacy (2016) by charlieyu1 on Saturday September 17, 2022 @02:00AM (#32875140)
I mean the outdated tutorials still suggest icon fonts. What’s a good alternative?
Re:Blocking web fonts for speed and privacy (2016) by c12 on Saturday September 17, 2022 @03:09AM (#32875427)
I sometimes use svg's define symbol method `<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>`.
Re:Blocking web fonts for speed and privacy (2016) by termin4l on Saturday September 17, 2022 @09:50AM (#32877536)
Use 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/