Paweł
Paweł

Reputation: 427

squares instead of icons fontawesome

Im trying to add an icon to my web from fontawesome. What I want to do is import it without using cdns.

My html code looks like this:

<div class="footer__socialmedia__icons">
  <i class="fab fa-facebook-f"></i>
  </i>
</div>

My app.scss file looks like this:

// Fonts
// =================================================

@import "../../../node_modules/@fortawesome/fontawesome-free/scss/fontawesome.scss";
@import "../../../node_modules/@fortawesome/fontawesome-free/scss/regular.scss";
@import "../../../node_modules/@fortawesome/fontawesome-free/scss/solid.scss";
@import "../../../node_modules/@fortawesome/fontawesome-free/scss/brands.scss";
@import "../../../node_modules/@fortawesome/fontawesome-free/scss/v4-shims.scss";

The only way it worked was adding this:

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">

but I really want to keep it localy...

Upvotes: 0

Views: 115

Answers (1)

Paweł
Paweł

Reputation: 427

Okay, my problem got solved. Maybe this will help someone: All I needed to do was import a js file into my app.js component. In my code it looks like this

import '../../../node_modules/@fortawesome/fontawesome-free/js/all'

Cheers

Upvotes: 1

Related Questions