EssaidiM
EssaidiM

Reputation: 8342

How to use FontAwsome as a font-family in Angular

I want to use the fontAwsome as a fontFamily in my css file, in order to change the <li> after icon.

In normal HTML/CSS i can do like this with no issue :

ul li:not(:last-child):after {
font-family: 'FontAwesome';
content: '\f105';
font-size: 13px;
top: 0px;
right: 0;
position: absolute;
}

but with angular I can't access the FontAwesome in my css files.

In my component html, I use this with no issues : <fa-icon icon="home"></fa-icon> .

Upvotes: 0

Views: 1456

Answers (1)

  1. npm i font-awesome
  2. import in your css : @import "~font-awesome/css/font-awesome.css"
  3. in your html, you just need to do something like this : <i class="fa fa-home"></i>

Upvotes: 3

Related Questions