Skip to content

Instantly share code, notes, and snippets.

@IgnacioGaldames
Created March 30, 2020 15:19
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 IgnacioGaldames/bb6513fa797f0a557cddd6f3d58c910f to your computer and use it in GitHub Desktop.
Save IgnacioGaldames/bb6513fa797f0a557cddd6f3d58c910f to your computer and use it in GitHub Desktop.
Font face using fonts array
$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