Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to import font-awesome in tailwind css in the rails application [closed]

I am trying to import font-awesome in my rails application which uses tailwind css framework.Unfortunately instead of icons square boxes show up in my application.

Steps followed:

yarn add --dev @fortawesome/fontawesome-free

application.scss
@import "@fortawesome/fontawesome-free";

I tried so many ways but not able to display icons. Can someone let me know how to resolve this?

like image 514
Veda Avatar asked Oct 24 '25 12:10

Veda


1 Answers

try this:

# application.scss
$fa-font-path: '~@fortawesome/fontawesome-free/webfonts'; 
@import '~@fortawesome/fontawesome-free/scss/fontawesome';
@import '~@fortawesome/fontawesome-free/scss/regular';
@import '~@fortawesome/fontawesome-free/scss/solid';
like image 53
Joel Cahalan Avatar answered Oct 26 '25 21:10

Joel Cahalan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!