Skip to content

Instantly share code, notes, and snippets.

@blocksector
Last active December 23, 2015 12:09
Show Gist options
  • Save blocksector/6633183 to your computer and use it in GitHub Desktop.
Save blocksector/6633183 to your computer and use it in GitHub Desktop.
sass mixin for embeded fonts.usage@include font-face( [font family name], [font filename] );
@mixin font-face($font-family, $font, $weight : normal, $style : normal) {
@font-face {
font-family: $font-family;
src: url('path/to/font/#{$font}.eot');
src: url('path/to/font/#{$font}.eot?#iefix') format('embedded-opentype'),
url('path/to/font/#{$font}.woff') format('woff'),
url('path/to/font/#{$font}.ttf') format('truetype'),
url('path/to/font/#{$font}.svg##{$font-family}') format('svg');
font-weight: $weight;
font-style: $style;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment