Fontawesome not working with Admin Template

Topic: Fontawesome not working with Admin Template

BizRTC pro asked 2 weeks ago


I am trying to use SVG Icons with Admin Template, but When I attach the scripts and css for FontAwesome 5 with SVG it does not look good. 

It looks like this without SVG :

Without SVG


When SVG is CSS and JS are added it looks like this :




My Code is as below:


<!--Grid column-->
<div class="col-xl-3 col-md-6 mb-4">

<div class="card card-cascade cascading-admin-card">

<!--Card Data-->
<div class="admin-up">
<i class="fas fa-headset light-green lighten-1"></i>
<div class="data">
<h4 class="font-weight-bold dark-grey-text">20000</h4>
<!--/.Card Data-->

<!--Card content-->
<div class="card-body card-body-cascade">

<p class="card-text">Worse than last week (75%)</p>
<!--/.Card content-->


<!--Grid column-->


do you use Admin Dashboard Template? Because these icons work, but these admin cards need custom code which is included only in Admin Dashboard Template and nowhere else.



BizRTC pro commented 2 weeks ago

Yes Marta, I have bought Big Bundle and I have both MDB Pro and Admin Material Dashboard. The icons are also showing fine, the problem occurs only when I use SVG Icons.


okay, what SVG icons you want to use? Could you provide any source? Our main icons source is Font Awesome and we do not guarantee the correct operation of other icons.



BizRTC pro commented 2 weeks ago


When I link this FontAwesome Script to my Project the problems occurs :

I have already provided the source code in my question description

<script defer src="" integrity="sha384-EIHISlAOj4zgYieurP0SdoiBYfGJKkgWedPHH4jCzpCXLmzVsw1ouK59MuUtP4a1" crossorigin="anonymous"></script>
This is for using SVG in project


the main problem with your code is the fact that we are not using SVG to create our projects and only just simple CSS code from FA5. If you want to use SVG in our projects you have to do some hacks about that because JavaScript from FA5 is mixing about classes in HTML and It's not look good because JS is removing these classes all the more your project is not getting CSS styles. 

When you are using SVG it automatically created SVG with PATH and some 'data' attributes and removed dynamically all 'fas, fab, far' classes from HTML and changed it to dependency with JS. 

So you have to change every 'fas, fab, far' classes in your SCSS/CSS code to your custom classes, for example, change these classes for 'faz' and add this custom class to your  <i> tags where you are using FA5..

For an example:

<i class="fas fa-camera faz"></i> 




would you provide any link to the project? Because I'm still not sure how I can help you?



Please insert min. 20 characters.


Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: jQuery
  • MDB Version: 4.5.15
  • Device: Windows
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: Yes
  • Provided link: No