Skip to content

Instantly share code, notes, and snippets.

@dieunb
Last active October 12, 2017 07:37
Show Gist options
  • Save dieunb/4e1e4e68459342f2934553d32f80d84d to your computer and use it in GitHub Desktop.
Save dieunb/4e1e4e68459342f2934553d32f80d84d to your computer and use it in GitHub Desktop.
rails5 + bootstrap3, font-awesome with Yarn
# Font-awesome
vi node_modules/font-awesome/scss/_variables.scss
# Replace
$fa-font-path: "../fonts";
# with this code
$fa-font-path: "font-awesome/fonts";
# Bootstrap
vi node_modules/gentelella/vendors/bootstrap/dist/css/bootstrap.css
# Replace this
@font-face {
font-family: 'Glyphicons Halflings';
src: url('../fonts/glyphicons-halflings-regular.eot');
src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regula$
}
# with
@font-face {
font-family: 'Glyphicons Halflings';
src: url('bootstrap/fonts/glyphicons-halflings-regular.eot');
src: url('bootstrap/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('bootstrap/fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('bootstrap/fonts/glyphicons-halflings-regular.woff') format('woff'), url('bootstrap/fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('bootstrap/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}
# Compile again with disable yarn install task runtime
cd bin/
mv yarn _yarn
cd ..
RAILS_ENV=production rails assets:precompile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment