Skip to content

How to add a new font awesome icon

Florence Berbey edited this page Jan 4, 2024 · 2 revisions

TL;DR

In order to optimize distribution files sizes, only used font-awesome icons are included in the project.

How-to ?

If you need to use a new icon, please follow this steps :

  1. identify your icon name, and icon category (solid or regular). Let's say it's far fa-terrible-icon
  2. open /src/js/vue-plugins/font-awesome-config.js
  3. in relevant import block (regular or solid), add faTerribleIcon
  • please keep alphabetical order
  • and if your icon is regular, rename it : faTerribleIcon as faTerribleIconRegular
  1. in library.add block, add faTerribleIconRegular
  2. that's all, enjoy :
<fa-icon :icon="['far', 'terrible-icon']"></fa-icon>

Oh, and a small reminder : if your remove an icon component from a vue file, please have a rapid check if this icon is used in another source. If not, remove it from fa.config.js.

See more