Font Awesome icons

When to use

Font Awesome is a commercial icon service that allows us to use scalable vector icons on our pages. Basically, this means we can add icons to our pages and they will look good in any size and on any device. These icons can enhance the user experience and visual appeal of your site.

The Font Awesome collection includes many types of icons. You might want to try:

  • Shapes/artifacts: book
  • UX elements: external link
  • Logos: Facebook

We use the book icon in our examples below.

Basic usage:

[fa icon="book"]

  1. Look-up the name of the icon in the Font Awesome database by going to: http://fontawesome.io/icons/
  2. Click on the icon you want. There you will see a code for the icon: fa-book
  3. Remove the initial “fa-” from the code. Now you’ll have something like: book
  4. Add your shortened code into the short code formula: [fa icon="book"]

Optional attributes: color, size, stacked

By default, your icon will inherit the text styling of the adjacent text. Often, you will want the icons to stand-out. Luckily, the Web Team gurus have added some of these features to the shortcode as optional attributes.

Color

The color attribute changes the color of the icon. Right now, we support three colors. Here are examples for book :

  • A blue book: [fa icon="book" color="blue"]
  • A green book: [fa icon="book" color="green"]
  • An orange book: [fa icon="book" color="orange"]

Example in use: Social media icons on IAS sidebar

Size

The size attribute changes the size of the icon. We support the default size and four more using the size attribute.

  • Default [fa icon="book"]
  • Size 2: [fa icon="book" size="2"]
  • Size 3: [fa icon="book" size="3"]
  • Size 4: [fa icon="book" size="4"]
  • Size 5: [fa icon="book" size="5"]

Example in use: Social media icons on IAS sidebar

Stacked

The stacked attribute lets you enhance the icon even more by centering the icon in a circle or a square. This can be combined with the color and size attributes to great effect.

  • Book in a circle: [fa icon="book" stacked="circle"]
  • Book in a square: [fa icon="book" stacked="square"]
  • Bigger book in a green square: [fa icon="book" stacked="square" size="2" color="green"]

Example in use: FYI home page

Using Font Awesome icons in links

Developers commonly use Font Awesome icons to identify the purpose of hyperlinks. For example, sometimes they will place an envelope before an email address or an external link symbol after an external link. As icons inherit link styling, a neat effect can be achieved by wrapping the icon in the anchor tag. Consider the following examples for an external link:

Icon outside the anchor element:

Code: <a href="http://www.google.com">Google</a> [fa icon="external-link"]]
Rendering: Google

Icon inside the anchor element:

Code: <a href="http://www.google.com">Google [fa icon="external-link"]</a>
Rendering: Google

Example in use: European Studies Collections and Services