Skip to content

Instantly share code, notes, and snippets.

@strsar
Created January 30, 2017 17:35
Show Gist options
  • Save strsar/a23c45b905995bc8a00ff9ce1bdafd97 to your computer and use it in GitHub Desktop.
Save strsar/a23c45b905995bc8a00ff9ce1bdafd97 to your computer and use it in GitHub Desktop.
[SCSS] - @font-face mixin
/**
* Build @font-face
*
* @vars {@family}, {@path}, {@weight}, {@style}
*/
@mixin typeface($family, $path, $weight: normal, $style: normal) {
@font-face {
font-family:$family;
src: url('#{$path}.woff2') format('woff2'),
url('#{$path}.woff') format('woff'),
url('#{$path}.ttf') format('truetype');
font-weight:$weight;
font-style:$style;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment