Skip to content

Instantly share code, notes, and snippets.

@sgreenfield
Created January 3, 2012 22:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sgreenfield/1557278 to your computer and use it in GitHub Desktop.
Save sgreenfield/1557278 to your computer and use it in GitHub Desktop.
Compass font-face mixin
@mixin font-face(
$name,
$font-files,
$eot: false,
$weight: false,
$style: false
) {
$iefont: unquote("#{$eot}?iefix");
@font-face {
font-family: quote($name);
@if $eot {
src: font-url($eot);
$font-files: font-url($iefont) unquote("format('eot')"), $font-files;
}
@if $weight { font-weight: $weight; }
@if $style { font-style: $style; }
src: $font-files;
}
}
@ThatGuyCND
Copy link

Is this the correct use?

@include font-face("this name", font-files("this.woff", woff, "this.otf", opentype), "this.eot")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment