Skip to content

Instantly share code, notes, and snippets.

@thegrid22593
Created November 22, 2017 01:21
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 thegrid22593/c989ccc8246a34248d970d864c37f4ce to your computer and use it in GitHub Desktop.
Save thegrid22593/c989ccc8246a34248d970d864c37f4ce to your computer and use it in GitHub Desktop.
Mixin for creating font family for web fonts
$namespace-fonts: $font1, $font2, $font3;
$font-path: 'your/font/path';
// Font-face loader
@each $font-face in $namespace-fonts {
@font-face {
font-family: #{$font-face};
src: url('#{$font-path}/#{$font-face}.eot');
src: url('#{$font-path}/#{$font-face}.eot?') format('eot'),
url('#{$font-path}/#{$font-face}.woff') format('woff'),
url('#{$font-path}/#{$font-face}.woff2') format('woff2'),
url('#{$font-path}/#{$font-face}.ttf') format('truetype'),
url('#{$font-path}/#{$font-face}.svg##{$font-face}') format('svg');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment