Skip to content

Instantly share code, notes, and snippets.

@travis-g
Created August 13, 2015 20:25
Show Gist options
  • Save travis-g/5c8e8bba8e811237e27c to your computer and use it in GitHub Desktop.
Save travis-g/5c8e8bba8e811237e27c to your computer and use it in GitHub Desktop.
Stylus function for defining webfonts
file-url(file, path = '../fonts/)
return path + file
font-face(family, file, weight = 'normal')
@font-face
font-family family
src url(file-url(file + '.eot'))
src url(file-url(file + '.eot?#iefix')) format('embedded-opentype'),
url(file-url(file + '.woff2')) format('woff2'),
url(file-url(file + '.woff')) format('woff'),
url(file-url(file + '.otf')) format('opentype'),
url(file-url(file + '.ttf')) format('truetype'),
url(file-url(file + '.svg#'+ family)) format('svg')
font-weight weight
font-style normal
font-face('Roboto', 'roboto/Roboto-Regular')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment