Skip to content

Instantly share code, notes, and snippets.

@ColemanCollins
Created January 20, 2015 21:33
Show Gist options
  • Save ColemanCollins/e2aa1d3f4d4b39c9ea02 to your computer and use it in GitHub Desktop.
Save ColemanCollins/e2aa1d3f4d4b39c9ea02 to your computer and use it in GitHub Desktop.
example font face mixin. why keep typing this shit?
@mixin font-path($filename) {
src: url(font-path('#{$filename}.eot') + "?#iefix") format('embedded-opentype'),
url(font-path('#{$filename}.woff')) format('woff'),
url(font-path('#{$filename}.ttf')) format('truetype'),
url(font-path('#{$filename}.svg') + "##{$filename}") format('svg');
}
@font-face {
font-family: 'DIN-Condensed';
@include font-path(DINCond-Light);
font-weight: $font-light;
font-style: normal;
}
@ColemanCollins
Copy link
Author

the thing to note here is the #{hash-handlebar} variable interpolation. doesn't work without it.

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