Skip to content

Instantly share code, notes, and snippets.

@Yipee-ki-yay
Last active October 17, 2018 08:41
Show Gist options
  • Save Yipee-ki-yay/1fc87527416495609e0ff01914ee46b4 to your computer and use it in GitHub Desktop.
Save Yipee-ki-yay/1fc87527416495609e0ff01914ee46b4 to your computer and use it in GitHub Desktop.
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