Skip to content

Instantly share code, notes, and snippets.

@imlinus
Created October 28, 2013 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imlinus/7198707 to your computer and use it in GitHub Desktop.
Save imlinus/7198707 to your computer and use it in GitHub Desktop.
font-face mixin (with IE8 support)
// 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