Implemented Include Font Awesome By Default

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.
 
Upvote 99
This suggestion has been implemented. Votes are no longer accepted.
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.
 
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)....
http://xenforo.com/community/resources/font-awesome-local-install.3262/

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.
 
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.
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
 
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 :)
 
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.
 
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.
 
Now that XenForo Media Gallery enable Font Awesome call in all pages, please replace all images icons with Font Awesome Icons. Please.

So that we can have more benefits of calling that FontAwesome css, font icons in all pages.
Right now it's 90% useless on other pages except Media Gallery page and Profile Pages with gallery content.
And the dis-advantages it adds more than 100kb per pages :(

Thanks!
 
And the dis-advantages it adds more than 100kb per pages :(
That's not quite accurate.

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

upload_2014-11-12_14-3-48.webp

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:

upload_2014-11-12_14-9-24.webp

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.
 
Back
Top Bottom