Open main menu

FontAwesome

Revision as of 09:33, 17 November 2016 by Freephile (talk | contribs) (notes about using Font Awesome)

(diff) ← Older revision | Approved revision (diff) | Latest revision (diff) | Newer revision → (diff)

Font Awesome

So you want a rocket on your page to show how awesome your stuff is. Something like this: http://fontawesome.io/icon/rocket/

<i class="fa fa-rocket fa-6" aria-hidden="true"></i>

Is how to show a Font Awesome icon. Which looks like this:

Problems

But there is a dependency and some bugs that have to be tracked down with regard to using it on a wiki site.

  1. Font Awesome only seems to work if there is an actual image on the page. For example, this is an edit icon from a normal svg file. OOjs UI icon edit-ltr.svg. Remove that and your Font Awesome icon will disappear. Note: the image file doesn't even have to exist, it's just that the image processing code is not called unless there is a [[File:]] tag in the wikitext.
  2. And FA doesn't work if I close the tag properly.
  3. The fa element is duplicated throughout the rest of the page since it wasn't closed.

Getting it

  1. Sign up for a unique embed code.
  2. Add the script source to your wiki by editing the MediaWiki:Common.js file where you add a call to 'load' the external script mw.loader.load('//use.fontawesome.com/14c71d3de0.js');
  3. Insert the <i> tags where ever you want. Note that there are various sizes pre-defined as fa-1 (smallest) to fa-6 (largest)
  4. Check http://fontawesome.io/examples/
  5. https://cdn.fontawesome.com/help#qa-icons-code
  6. https://stackoverflow.com/questions/tagged/font-awesome
  7. https://github.com/FortAwesome/Font-Awesome