Created
November 22, 2017 01:21
-
-
Save thegrid22593/c989ccc8246a34248d970d864c37f4ce to your computer and use it in GitHub Desktop.
Mixin for creating font family for web fonts
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
$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