Skip to content

Instantly share code, notes, and snippets.

@GarySwift
Last active March 29, 2020 02:08
Show Gist options
  • Save GarySwift/85ba55010240f1b46e6f0c1da4dd4d4a to your computer and use it in GitHub Desktop.
Save GarySwift/85ba55010240f1b46e6f0c1da4dd4d4a to your computer and use it in GitHub Desktop.
Installing Font Awesome into FoundationPress.

Font Awesome Notes

This gist is just a quick reminder for myself of how to install Font Awesome into Ole Fredrik's FoundationPress.

Install via bower

bower install font-awesome --save

Font Awesome Assets

Bower will install the Font Awesome webfont files into the same bower directory. However, this will not work with our sass import into src/assets/scss/app.scss.

The official Font Awesome docs say we should open the font-awesome directory and edit the font path like so @fa-font-path: "../font";.(Getting Started)

This will cause problems for our version control so an easier method is to copy the font directory into our dist/assets directory.

Via terminal
cp -r ./bower_components/font-awesome/fonts/. ./src/assets/fonts/

All Together

bower install font-awesome --save && cp -r ./bower_components/font-awesome/fonts/. ./src/assets/fonts/

Edit app.scss

(src/assets/scss/app.scss)

Finally, we need to add this import statement to app.scss.

// Libraries
@import "../../../bower_components/font-awesome/scss/font-awesome.scss";
@anthonyabraira
Copy link

Just thought you should know that the paths have changed slightly.

cp -r ./bower_components/font-awesome/otfs/. ./src/assets/fonts/

and for the Libraries

@import "../../../bower_components/font-awesome/scss/fontawesome.scss";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment