Skip to content

Instantly share code, notes, and snippets.

@githiro
Created January 21, 2015 09:02
Show Gist options
  • Save githiro/51a4b8fc3b07027aef11 to your computer and use it in GitHub Desktop.
Save githiro/51a4b8fc3b07027aef11 to your computer and use it in GitHub Desktop.
SASS: font-face mixin
@mixin font-face($fontname, $fontpath, $hasSVG: false, $isBold: false, $hasStyle: false) {
@font-face {
font-family: $fontname;
src: url('#{$fontpath}.eot?rev=#{$rev}');
src: url('#{$fontpath}.eot?iefix&rev=#{$rev}') format('eot'),
url('#{$fontpath}.woff?rev=#{$rev}') format('woff'),
url('#{$fontpath}.ttf?rev=#{$rev}') format('truetype'),
url('#{$fontpath}.svg?rev=#{$rev}#webfontjSpbZQRv') format('svg');
@if $isBold {
font-weight: bold;
}
@if $hasStyle != false {
font-style: $hasStyle;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment