Skip to content

Instantly share code, notes, and snippets.

@iamkeir
Created June 19, 2014 12:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamkeir/30ec9b01d71d5fe49c81 to your computer and use it in GitHub Desktop.
Save iamkeir/30ec9b01d71d5fe49c81 to your computer and use it in GitHub Desktop.
Lazy font-face generator (SCSS)
// 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