-
-
Save Djules/e564bc795ae11fed8902 to your computer and use it in GitHub Desktop.
Updated Stylus mixin @font-face
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
// Fonts mixin | |
font-file(file, ext, path) | |
return path + file + ext | |
webfont(family, file, path = '../fonts/', hack-chrome-windows = false, weight = 'normal', style = 'normal') | |
@font-face | |
font-family family | |
src url(font-file(file, '.eot', path)) | |
src url(font-file(file, '.eot?#iefix', path)) format('embedded-opentype'), | |
url(font-file(file, '.woff', path)) format('woff'), | |
url(font-file(file, '.ttf', path)) format('truetype'), | |
url(font-file(file, '.svg#'+ family, path)) format('svg') | |
font-weight weight | |
font-style style | |
if hack-chrome-windows | |
@media screen and (-webkit-min-device-pixel-ratio:0) | |
@font-face | |
font-family family | |
src url(font-file(file, '.svg#'+ family, path)) format('svg') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Added path for font files location, and style for font-style attribute.
How to use :