Created
April 25, 2016 08:22
-
-
Save jbrz0/30331cdac933991ee0abc093ec123661 to your computer and use it in GitHub Desktop.
Sass 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