React-redux-starter-kit: Font-Awesome

Created on 26 Jan 2016  路  9Comments  路  Source: davezuko/react-redux-starter-kit

Does this kit come with font-awesome?

If not, where would I add it after getting the dependencies from npm?

Thanks!

question

Most helpful comment

The following worked for me:

  1. Install Font Awesome (yarn add font-awesome)
  2. Add to src/styles/core.scss:
$fa-font-path: '~font-awesome/fonts';
@import "~font-awesome/scss/font-awesome";

All 9 comments

Just import it into core.scss:

@import "~font-awesome/scss/font-awesome";

or

@import "~Font-Awesome/scss/font-awesome";

(depending on how it was imported with npm)

Thanks for the answer. I did do it the way you suggest it.

I did what you suggested, and but having path issues. seems that font-awesome can't find its fonts folder.. Any idea what am I missing? Thanks!

ERROR in ./~/css-loader?sourceMap&-minimize&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!./~/postcss-loader!./~/sass-loader?sourceMap!./src/styles/core.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/fontawesome-webfont.eot in /Users/simon/CowBook/CowBook-Web-App/src/styles
 @ ./~/css-loader?sourceMap&-minimize&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!./~/postcss-loader!./~/sass-loader?sourceMap!./src/styles/core.scss 6:201950-202001

edit the $fa-font-path inside the _variable.scss inside the node-modules/font-awesome/scss
from '../fonts' to './fonts' and placed the fonts inside the your style folder

@simonlinj did you find a solution? Everything else I have seen has seemed hacky.

danwad's solution from #474 for bootstrap-sass works for me here as well. Once you follow his directions to set up src/styles/global/global.scss outside of CSS module, add the following:

$fa-font-path: "~font-awesome/fonts";
@import "~font-awesome/scss/font-awesome";

This seems like a lot of work for something that should be a lot easier. Simply importing the appropriate file should be sufficient. Perhaps a enhancement is needed here?

it doesnt work for me, the fonts dont render at all, no warnings or anything im using..

$icon-font-path: '~bootstrap-sass/assets/fonts/bootstrap/';
$fa-font-path: '~font-awesome/fonts';
@import '~bootstrap-sass/assets/stylesheets/_bootstrap.scss';
@import '~font-awesome/scss/font-awesome.scss';

The following worked for me:

  1. Install Font Awesome (yarn add font-awesome)
  2. Add to src/styles/core.scss:
$fa-font-path: '~font-awesome/fonts';
@import "~font-awesome/scss/font-awesome";
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ciokan picture ciokan  路  4Comments

nie-xin picture nie-xin  路  4Comments

maxkrieger picture maxkrieger  路  4Comments

gilesbradshaw picture gilesbradshaw  路  5Comments

renanvalentin picture renanvalentin  路  5Comments