Created
June 19, 2014 12:24
-
-
Save iamkeir/30ec9b01d71d5fe49c81 to your computer and use it in GitHub Desktop.
Lazy font-face generator (SCSS)
This file contains hidden or 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
// Lazy font-face generator | |
// @TODO: Consider additional mixin parameter to specify which font filetypes to output, e.g. "eot, woff" | |
@mixin font-face($label,$font) { | |
@font-face { | |
font-family: $label; | |
src: url('#{$font_path}#{$font}.eot'); | |
src: url('#{$font_path}#{$font}.eot?#iefix') format('embedded-opentype'), | |
url('#{$font_path}#{$font}.woff') format('woff'), | |
url('#{$font_path}#{$font}.ttf') format('truetype'), | |
url('#{$font_path}#{$font}##{$label}') format('svg'); | |
font-weight: normal; | |
font-style: normal; | |
} | |
} | |
// Set up custom font-face | |
@include font-face("font family label","webfont-filename"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment