Last active
October 17, 2018 08:41
-
-
Save Yipee-ki-yay/1fc87527416495609e0ff01914ee46b4 to your computer and use it in GitHub Desktop.
mixin for including fonts for font-face
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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