Skip to content

Instantly share code, notes, and snippets.

@marvinahv
Last active September 29, 2015 21:48
Show Gist options
  • Save marvinahv/1673812 to your computer and use it in GitHub Desktop.
Save marvinahv/1673812 to your computer and use it in GitHub Desktop.
A little mixin to add fonts from Font Squirrel
// Mixin to use fonts generated by Font Squirrel (http://www.fontsquirrel.com)
@mixin font_squirrel_font($font-name, $file-name){
$font-url: "/font/#{$file-name}";
@font-face {
font-family: $font-name;
src: "#{$font-url}.eot";
src: local("#{$font-name}"), url("#{$font-url}.eot?#iefix") format("embedded-opentype"),
url("#{$font-url}.woff") format("woff"),
url("#{$font-url}.ttf") format("truetype"),
url("#{$font-url}.svg##{$font-name}") format("svg");
font-weight: normal;
font-style: normal;
}
}
// FONTS
@include font_squirrel_font('Name of Font', 'name-of-font-file');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment