Last active
July 14, 2017 18:38
-
-
Save jonnymaceachern/9f2acb65fe58e4c0b64a to your computer and use it in GitHub Desktop.
Mixin to declare font face for all file types (.eot, .woff, .ttf, .svg)
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 declare-font-face($font-family, $font-filename, $font-weight : normal, $font-style :normal, $font-stretch : normal) { | |
@font-face { | |
font-family: '#{$font-family}'; | |
src: url(font-path('#{$font-filename}.eot')); | |
src: url(font-path('#{$font-filename}.eot?#iefix')) format('embedded-opentype'), | |
url(font-path('#{$font-filename}.woff')) format('woff'), | |
url(font-path('#{$font-filename}.ttf')) format('truetype'), | |
url(font-path('#{$font-filename}.svg##{$font-family}')) format('svg'); | |
font-weight: $font-weight; | |
font-style: $font-style; | |
font-stretch: $font-stretch; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment