I integrated fontawesome
5 in a project with bootstrap 4. When I recall a font via css
it does not work.
with fontawesome 4 the code was as follows:
#mainNav .navbar-collapse .navbar-sidenav .nav-link-collapse:after {
float: right;
content: '\f107';
font-family: 'FontAwesome'; }
I tried to change the font name but it does not work
font-family: 'Font Awesome 5 Free'
Using the fontawesome-all.css file: Changing the "Brands" font-family from "Font Awesome 5 Free" to "Font Awesome 5 Brands" fixed the issues I was having.
I can't take all of the credit - I fixed my own local issue right before looking at the CDN version: https://use.fontawesome.com/releases/v5.0.6/css/all.css
They've got the issue sorted out on the CDN as well.
If you are using SVG with JavaScript you need to enable this because it's disabled by default. Use
<script data-search-pseudo-elements ... >
inside your script tag.
Requiring 900 weight is not a weirdness but a intentional restriction added by FontAwesome (since they share the same unicode but just different font-weight) so that you are not hacking your way into using the 'solid' and 'light' icons, most of which are available only in the paid 'Pro' version.
Strangely you must put the 'font-weight: 900' in some icons so that it shows them.
Your
Unicode
is wrongf107
Or in other case,
font-weight: 900;
will save you. Some icons in font awesome 5 not working withoutfont-weight: 900;
.npm i --save @fortawesome/fontawesome-free
My Sccs:
It worked fine for me!