-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
Update to Font Awesome 6, switch to Bootstrap Icons or inline-svg? #46
Comments
My suggestion would be to replace all icons with the .svg version of the bootstrap icon font (all icons are directly available as .svg files also) and separate the icon font implementation to a plugin maybe with an selector for your proffered font which. I think inline svg would be the most performant in browsers for optimized css and reduced file requests and a non flickering loading process :) (https://cloudfour.com/thinks/svg-icon-stress-test/) |
I'm personally more a fan of FontAwesome, but that's mostly because I'm biased as I use the Pro version so I have way more variation. I quite like the Bootstrap icons, but never used them, and I'd still prefer FontAwesome because the icons feel a bit more consistent. |
The reason why I suggested it is just that its a lot to load a full icon font on a page for just around 10 items. Most of the plugins ship with their own version anyways but you can deselect it there. Improvements I am looking for with the decoupling of the icon font from the theme (we can offer it by plugin or just make a section you can comment in or out without breaking the theme) Pro in my opinion
Con in my opinion
Hit me with your thoughts :) |
I'm getting more and more warm with this idea and agree that it's not necessary to load 1500+ icons if we just use less then 10 of them.
We can copy the Font Awesome glyphs or download svg to create own icons https://fontawesome.com/v5.15/icons/bars?style=solid. We must add credits and license. Still a bit worry to adjust the inline-svg‘s, they must change as well if button style or size changes. What‘s about this: I used https://icomoon.io many times to create custom icon fonts. We can create a custom font set using FA icon svg's. If we name them like FA, for example |
Inline svgs are actually pretty nice to work with nowadays. Maybe take a look at FontAwesome's JS edition, which replaces the html tag with inline svgs, and also responds to sizes and colors. I'm also able to create a subset with FontAwesome icons, only including the ones we need. https://fontawesome.com/v5.15/how-to-use/on-the-desktop/other-topics/subsetter |
Good Idea! Created a rough sketch of a webfont with only 6 icons icomoon.zip. Just to catch some ideas. |
I would still prefer a non "extra" request solution but 6 icons is of course way better than all of them ;) I added a codepen where the color and size of the inline svg (which is a bootstrap icon svg) are already changing with the text. The vertical alignment would need some improvement still but I think we could figure that out as well :) |
Oh I didn't mean to use the JS edition, I meant look at their svg code and css they're using for it, and then we can just implement the few styling lines we need to make them work properly. |
I quoted the wrong part, I meant the custom font one, my mistake :D I tried to find the docs for the fontawesome js part but could't find the according css. @justinkruit is it easy for you to find out what css they are using and how it is different from my codepen? |
@Axos11 I quickly made an html file which loads a FA JS kit, and added some icons. Here it just replaces the i tags with svg, and put some styling in the head which will make the fontawesome icons work correctly, like we're used to. We can pick from that style tag what we need, and then we're sure all the alignment etc functions like we're used to with FA. |
@justinkruit thanks, i adapted my codepen and implemented their alignment adaption ( vertical-align: -.125em; ) @crftwrk i like the 3kb of the icon font :) it's good to know that if the inline .svg approach shouldn't work out as planned we have a good fallback! |
Font Awesome 6 is already in Beta3. Classes for icons has nothing to do with current installed Font Awesome 5 anymore.
This seems to be the right point to think about to switch to Bootstrap Icons instead update to FA6. Because classes changed and we must change them anyway.
Icons are used in
In my opinion, Font Awesome has more visual power.
The text was updated successfully, but these errors were encountered: