Skip to content

Instantly share code, notes, and snippets.

@ChunAllen
Forked from tagrudev/gist:4276467
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChunAllen/03d8cb580b54efe10ee4 to your computer and use it in GitHub Desktop.
Save ChunAllen/03d8cb580b54efe10ee4 to your computer and use it in GitHub Desktop.
##
Lets say we have YoloFont.otf
1. We add it to vendor/assets/fonts/ folder
2. Me personaly creates a file named fonts.css.scss in app/assets/stylesheets
In it I have
@font-face{
font-family: 'YoloFont';
src: font-url("YoloFont.otf") unquote("format('opentype')");
font-weight: normal;
font-style: normal;
}
3. Mark the opentype it may vary to your font format
4. In your app/assets/stylesheets/application.css.scss
@import "fonts";
$my_yolo_font: 'YoloFont';
5. You can use it with
font-family: $my_yolo_font;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment