Are you using SCSS as a CSS preprocessor in your project? No problemo, Font Awesome has an SCSS version if you'd prefer to import our styling into your workflow.
We’ll cover the basics of picking the SCSS files you’ll need for your project, adding Font Awesome to your compile, inject code into a class with Mixins, and more.
How's This Organized?
Here are some details on the mixins and files made specifically for SCSS.
|Files ||What They Do|
|Main Font Awesome compile|
|Brands icon styles|
|Solid icon styles|
|Regular icon styles|
|Light icon styles|
|Duotone icon styles|
|Base icon reference class syntax and definition|
|Utilities used throughout styling/icon definitions|
|All icon definitions|
|Where variables are defined that are used throughout styling|
|animated icon support styling|
|bordered + pulled icon support styling|
|fixed-width icon support styling|
|icon sizing support styling|
|icons in a list support styling|
|rotating icons support styling|
|stacking icons support styling|
|screen-reader specific and accessibility support styling|
Adding Font Awesome to Your Compile
scss folder into your project. Then copy the entire
webfonts folder into your project where your static files get served.
Open your project's
scss/variables.scss and edit the
$fa-font-path variable to point to where you placed the
Import Font Awesome by adding
@import "scss/fontawesome.scss" in your main SCSS file. Also, import one or more styles
@import "scss/solid.scss" in your main SCSS file. Compile your code and get to using those new icons in your project!
Using Our Mixins
You can use
@include fa-icon; to get things set up as an icon. Use
@extend .fas; to create an icon in the Solid style. Import other styles to use other prefixes. Use
fa-content and variable names to make including
content values a little easier. Sass can be grumpy (or you know, Sassy) about this.