Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save guilhermepontes/e623bec16e40ad2474b55f9a34401dee to your computer and use it in GitHub Desktop.
Save guilhermepontes/e623bec16e40ad2474b55f9a34401dee to your computer and use it in GitHub Desktop.
Sass mixin for including fonts for font-face
@mixin font-face($font-name, $file-name, $weight: normal, $style: normal) {
@font-face {
font-family: quote($font-name);
src: url($file-name + '.eot');
src: url($file-name + '.eot?#iefix') format('embedded-opentype'),
url($file-name + '.woff') format('woff'),
url($file-name + '.ttf') format('truetype'),
url($file-name + '.svg##{$font-name}') format('svg');
font-weight: $weight;
font-style: $style;
}
}
//Usage
@include font-face('gotham', '/fonts/gotham');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment