Created
August 13, 2015 20:25
-
-
Save travis-g/5c8e8bba8e811237e27c to your computer and use it in GitHub Desktop.
Stylus function for defining webfonts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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