Created
October 28, 2013 15:21
-
-
Save imlinus/7198707 to your computer and use it in GitHub Desktop.
font-face mixin (with IE8 support)
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 for custom webfonts with IE8 fallback | |
@mixin font-face( | |
$name, | |
$font-files, | |
$eot: false, | |
$weight: normal, | |
$style: normal | |
) { | |
$iefont: unquote("#{$eot}?#iefix"); | |
@font-face { | |
font-family: $name; | |
src: font-url($eot); | |
$font-files: font-url($iefont) unquote("format('embedded-opentype')"), $font-files; | |
src: $font-files; | |
font-weight: $weight; | |
font-style: $style; | |
} | |
} | |
// usage | |
@include font-face( | |
'icomoon', | |
font-files( | |
"icomoon.woff", | |
"icomoon.svg" | |
), | |
"icomoon.eot" | |
); | |
@mixin icomoon { | |
font: { family: 'icomoon', sans-serif; } | |
} | |
.icon-one { | |
@include icomoon; | |
content: '\n601'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment