-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert icon font to SVG #291
Comments
Well, all icons are loaded in a single network request from a font. While SVGs would need to make requests per icon, until it hits the cache for each of them, it is definitely downside. Also, in our case we have a lot of repetitive usage of same icons, which makes SVG inlining - not viable as it will bloat the download sizes, and require re-interpretation of larger HTML again and again. Not even mentioning inserting inline icons from JS. And it is easy to use CSS, which then can use While font icons might give limitations in what icons are available and more difficult to author new ones, unless you own the font source. This has some benefits ensuring there is consistency and simplicity for the icons. |
You'd build all the individual SVG icons into a single SVG 'atlas' and to render a particular icon, you specify a sub-window into the SVG. You don't load each SVG as an individual file - although the 'source files' for the icons would be individual SVGs.
We probably wouldn't inline, but load the atlas once on the page and just reference icons where needed.
Well, I'm not sure I would 100% agree there. It's actually a pain to position and size icons that come from a font. You have to fiddle around with several CSS properties that can affect icon sizing and placement....whereas with SVG, you just set the size. |
Here's a good example of an SVG based icon set: https://github.com/lucide-icons/lucide So here are the source SVG icons: https://github.com/lucide-icons/lucide/tree/main/icons And this script builds the atlas: https://github.com/lucide-icons/lucide/blob/main/scripts/generateSuperSVG.mjs |
It's now 2023. There seems to be a reasonably strong consensus that icon fonts are inferior to SVG. For example, see the following for justification:
https://getdevdone.com/blog/icon-fonts-vs-svg-icons.html
https://www.lambdatest.com/blog/its-2019-lets-end-the-debate-on-icon-fonts-vs-svg-icons/
The text was updated successfully, but these errors were encountered: