Created
March 30, 2020 15:19
-
-
Save IgnacioGaldames/bb6513fa797f0a557cddd6f3d58c910f to your computer and use it in GitHub Desktop.
Font face using fonts array
This file contains 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
$fontsUrl : "unineue/"; | |
$fonts: | |
'unineuethin' 100 normal 'uni_neuethin', | |
'unineuethin-italic' 100 italic 'uni_neuethin_italic', | |
'unineuelight' 200 normal 'uni_neuelight', | |
'unineuelight-italic' 200 italic 'uni_neuelight_italic', | |
'unineuebook' 300 normal 'uni_neuebook', | |
'unineueregular' 400 normal 'uni_neueregular', | |
'unineueregular-italic' 400 italic 'uni_neueregular_italic', | |
'unineuebold' bold normal 'uni_neuebold', | |
'unineuebold-italic' bold italic 'uni_neuebold_italic', | |
'unineueheavy' 800 normal 'uni_neueheavy', | |
'unineueheavy-italic' 800 italic 'uni_neueheavy_italic', | |
'unineueblack' 900 normal 'uni_neueblack'; | |
@each $fontName, $fontWeight, $fontStyle, $fontSvg in $fonts { | |
@font-face { | |
font-family: "uni_neue"; | |
src: url($fontsUrl + $fontName + "-webfont.eot"); | |
src: url($fontsUrl + $fontName + "-webfont.eot?#iefix") format("embedded-opentype"), | |
url($fontsUrl + $fontName + "-webfont.woff2") format("woff2"), | |
url($fontsUrl + $fontName + "-webfont.woff") format("woff"), | |
url($fontsUrl + $fontName + "-webfont.ttf") format("truetype"), | |
url($fontsUrl + $fontName + "-webfont.svg##{$fontSvg}") format("svg"); | |
font-weight: $fontWeight; | |
font-style: $fontStyle; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment