A
A
Art Snail2018-04-24 08:31:38
Ruby on Rails
Art Snail, 2018-04-24 08:31:38

Why doesn't fontawesome work in production?

Adding bootstrap & font awesome to the project via yarn. Everything works locally. But in production, icons are not displayed, not bootstrap, not font awesome. Bootstrap works fine.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Apostol63, 2018-04-24
@Apostol63

how do you include font? maybe the paths have become wrong.
Try font connect online and check

V
Vasily Shakhunov, 2018-04-28
@inf

He does not understand the ways of assets. As a solution, you can take the original fontawesome.sccs from the yarn/npm package and replace it with your own _fontawesome.sccs with corrected paths to the fonts.

$fa-font-path: "font-awesome/fonts" !default;

@import "font-awesome/scss/variables";
@import "font-awesome/scss/mixins";

@font-face {
  font-family: 'FontAwesome';
  src: font-url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}');
  src: font-url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'),
  font-url('#{$fa-font-path}/fontawesome-webfont.woff2?v=#{$fa-version}') format('woff2'),
  font-url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'),
  font-url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'),
  font-url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg');
  font-weight: normal;
  font-style: normal;
}

@import "font-awesome/scss/core";
@import "font-awesome/scss/larger";
@import "font-awesome/scss/fixed-width";
@import "font-awesome/scss/list";
@import "font-awesome/scss/bordered-pulled";
@import "font-awesome/scss/animated";
@import "font-awesome/scss/rotated-flipped";
@import "font-awesome/scss/stacked";
@import "font-awesome/scss/icons";
@import "font-awesome/scss/screen-reader";

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question