Skip to content

Instantly share code, notes, and snippets.

@un1ko85
Forked from diogomoretti/fonts.styl
Last active August 29, 2015 14:18
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 un1ko85/0382532ba98eb56ac0f6 to your computer and use it in GitHub Desktop.
Save un1ko85/0382532ba98eb56ac0f6 to your computer and use it in GitHub Desktop.
// Fonts mixin
font-url(file)
return '../fonts/' + file
webfont(family, file, hack-chrome-windows = false, weight = 'normal')
@font-face
font-family family
src url(font-url(file + '.eot'))
src url(font-url(file + '.eot?#iefix')) format('embedded-opentype'),
url(font-url(file + '.woff')) format('woff'),
url(font-url(file + '.ttf')) format('truetype'),
url(font-url(file + '.svg#'+ family)) format('svg')
font-weight weight
font-style normal
if hack-chrome-windows
@media screen and (-webkit-min-device-pixel-ratio:0)
@font-face
font-family family
src url(font-url(file + '.svg#'+ family)) format('svg')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment