Skip to content

Instantly share code, notes, and snippets.

@irunatbullets
Last active August 29, 2015 14:00
Show Gist options
  • Save irunatbullets/0f3ae758ebfe5ee7f407 to your computer and use it in GitHub Desktop.
Save irunatbullets/0f3ae758ebfe5ee7f407 to your computer and use it in GitHub Desktop.
Compass font-face mixin wrapper.
// Super Font Face Mixin
// ============================================================================
//
// If you have a standard set of fonts (i.e. woff, ttf, svg, eot), instead of
// having to list every font file with the Compass font mixin, just use this
// wrapper.
//
// Usage examples:
// @include super-font-face('Museo Sans', 'MuseoSans_500-webfont');
// @include super-font-face('Museo Sans', 'MuseoSans_700-webfont', bold);
@mixin super-font-face($name, $font-file-name, $weight: false, $style: false) {
@include font-face(
$name,
font-files(
'#{unquote($font-file-name)}.woff',
'#{unquote($font-file-name)}.ttf',
'#{unquote($font-file-name)}.svg'
),
'#{unquote($font-file-name)}.eot',
$weight,
$style
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment