Answer the question
In order to leave comments, you need to log in
How to properly include third-party fonts in Rails5?
Third party fonts don't work.
app/assets/config/manifest.js
//= link_tree ../fonts
config/application.rb
config.assets.paths << Rails.root.join("app", "assets", "fonts")
config.assets .precompile << /\.(?:svg|eot|woff|ttf)$/
Fonts are in app/assets/fonts
application.scss
@font-face {
font-family: 'Comfortaa', serif;
src: font-url('Comfortaa/Comfortaa-Regular.ttf') format('truetype');
font-weight: normal
font-style: normal
}
main.scss
.title {
font-family: 'Comfortaa', serif;
}
Answer the question
In order to leave comments, you need to log in
Here is an excellent description of the solution for fonts.
In short, we create the assets / fonts
directory
And in css we use
font-family: 'simple-line-icons';
src: font-url("Simple-Line-Icons.eot");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question