Skip to content

Instantly share code, notes, and snippets.

@artlili
Created May 15, 2019 20:22
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 artlili/a5a96a617b20fb74a9d8f20c1fd0c3fa to your computer and use it in GitHub Desktop.
Save artlili/a5a96a617b20fb74a9d8f20c1fd0c3fa to your computer and use it in GitHub Desktop.
Fonts function
$font: ("Bold": bold, "Regular": normal, "Medium": 500, "Thin": 100);
@each $style, $width in $font {
$url: $base-font-family + '-' + #{$style};
$rel_url: '/fonts/' + $url + '/' + $url;
@font-face {
font-family: $base-font-family;
src: url($rel_url + '.eot');
src: url($rel_url + '.eot?#iefix') format('embedded-opentype'),
url($rel_url + '.woff') format('woff'),
url($rel_url + '.ttf') format('truetype'),
url($rel_url + '.svg#' + $url) format('svg');
font-weight: $width;
font-style: normal;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment