Skip to content

Instantly share code, notes, and snippets.

@widescreenBob
Created September 23, 2014 13:22
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 widescreenBob/912c1b656fb2a12ee178 to your computer and use it in GitHub Desktop.
Save widescreenBob/912c1b656fb2a12ee178 to your computer and use it in GitHub Desktop.
Font Face Example
//a variable to contain any extra path information required for the mixin
$base: path to font folder
//mixin (using shorthand) for fontface integration
=fontFace($family, $src, $weight: normal, $style: normal)
@font-face
font-family: $family
src: url("#{$base}/fonts/#{$src}.eot")
// IE9 compat
src: url("#{$base}/fonts/#{$src}.eot?#iefix") format("embedded-opentype"), url("#{$base}/fonts/#{$src}.woff") format("woff"), url("#{$base}/fonts/#{$src}.ttf") format("truetype"), url("#{$base}/fonts/#{$src}.svg") format("svg")
// legacy iOS
font-style: $style
font-weight: $weight
// Load Font Example, how you would use the above mixin
+fontFace(tobias-regular, tobias-regular-folder)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment