1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Include Font Awesome By Default

Discussion in 'XenForo Suggestions' started by Chris D, May 31, 2014.

  1. Chris D

    Chris D XenForo Developer Staff Member

    Just to be clear, I know there is already a suggestion that suggests replacing all XF sprites and icons with Font Awesome here: http://xenforo.com/community/threads/replace-all-images-with-font-awesome.63806/

    But this suggestion is much more simple and potentially more do-able sooner rather than later.

    My suggestion is:
    • An option in the Admin CP that allows us to select:
      • Font Awesome Disabled
      • Font Awesome CDN
      • Font Awesome Local
    • A template that is included in PAGE_CONTAINER by default
    • That template either loads nothing, Font Awesome from the Bootstrap CDN or a locally hosted Font Awesome CSS + fonts.
    What this does is it will give style designers, and add-on developers and admins the ability to freely make use of Font Awesome without it having to be included manually.

    There are cases where some sites are making several requests for the Font Awesome CSS. Some people are adding it themselves, some people have it with their custom styles and some people have it included in one or more add-ons.
  2. Steve F

    Steve F Well-Known Member

    Yes would be really nice to have this. We have had a few support tickets in that have been exactly for what @Chris has said about duplicate or even more calls to Font Awesome CDN.
    Adam Howard likes this.
  3. Adam Howard

    Adam Howard Well-Known Member

    The only issue with the local install is there would need to be clear instructions that you would need to upload the font awesome directory (folder) into your domain's root (not necessarily your forum root)....

    Unless of course KAM wish's to distribute XenForo with font awesome, editing the font awesome files in such away that they will match wherever forum root is located.

    However, I would rather not add that extra work into KAM and just have them include instructions (it would also make updating them more easier)

    But beyond that, I do support this idea.
  4. Alfa1

    Alfa1 Well-Known Member

    Yes, I have FA in my style, several of my addosn have it. My site loads it up to 3 times. Having it included in XF would be awesome ;)
    Adam Howard likes this.
  5. Marcus

    Marcus Well-Known Member

    Awesome suggestion!
    Adam Howard likes this.
  6. MattW

    MattW Well-Known Member

    After doing some work on the Adera theme (which comes with locally hosted version), I checked my UI.X theme. I had 3 versions of the CSS being called on each page load (my old version (3. something, the 4.0.3 version shipped with UI.X, and 4.1.0 with the new XMG from Chris). Removed the 2 older ones, and currently only loading the version from XMG
    Adam Howard and Steve F like this.
  7. Dinh Thanh

    Dinh Thanh Well-Known Member

    Adam Howard likes this.
  8. Markos

    Markos Well-Known Member

    Great suggestion! :)
  9. Dave Gandy

    Dave Gandy Member

    Hey folks. I make Font Awesome. I'm happy to help out in any way that makes this easier. Just let me know. :)
  10. Chris D

    Chris D XenForo Developer Staff Member

    In case you aren't familiar with XenForo, the 3 guys responsible for the software are @Ashley (business guy) and @Kier and @Mike (developers). I'm sure they'll see this and be in contact should they need anything :)
  11. meetdilip

    meetdilip Active Member

    Font awesome fan here. :)
  12. Slavik

    Slavik XenForo Moderator Staff Member

    Welcome to XenForo :)
    Dinh Thanh and SneakyDave like this.
  13. bousaid

    bousaid Well-Known Member

  14. Dinh Thanh

    Dinh Thanh Well-Known Member

    Great news for @Mike @Kier and for us :)
    Thank you.
  15. FredC

    FredC Well-Known Member

    This would prevent quite a bit of confusion. At one point before I was even a little familiar with FA I was calling up to three different versions in various templates. I guess for the most part all was well but Firefox refused to render various icons on various pages.
  16. Fufu

    Fufu Well-Known Member

    Does xenForo have to pay any licensing fee to include FA in the downloadable xenForo package?

    I see discounts for the new Black Tie; that is why I am asking about FA licensing.
  17. Chris D

    Chris D XenForo Developer Staff Member

  18. imthebest

    imthebest Formerly Super120

  19. RoldanLT

    RoldanLT Well-Known Member

  20. Chris D

    Chris D XenForo Developer Staff Member

    That's not quite accurate.

    The Font Awesome minified CSS comes down the wire at 6KB:


    Note the two different sizes here. 21.5 KB is the size of the content, but 6 KB is downloaded, most likely due to various compression, e.g. gzip etc.

    So 6KB it adds.

    However, look at the network tab in dev tools on a page where Font Awesome isn't explicitly used.

    If a Font Awesome icon is not used anywhere on the page, then the actual WOFF font files don't download. You will only see that download on various pages that actually use Font Awesome icons.

    (Note: The editor icon is a < 1 KB PNG file, not an actual icon)

    On a page that actually uses an icon, only then is the actual font downloaded. It isn't quite as compressible:


    So, at maximum, page loads are going to be loading 70 KB additional content. But, for most pages where Font Awesome is not used, it isn't loading anything more than an additional 6KB of CSS.

    But, throughout all of this, one important consideration is forgotten.

    Browsers are very capable at caching content, and actually both the CSS and Font can be loaded with less than 1 KB overhead from the browser's local cache. All in all, nothing to worry about.

    That being said, I'm still a huge advocate of Font Awesome and naturally I still want to see it in the core, but it may not make sense to do that unless XenForo itself is making use of it.

Share This Page