Created
September 20, 2016 23:42
-
-
Save mwanberg/48237cd54bb6bfa64ea040b97945d31a to your computer and use it in GitHub Desktop.
Generate @font-face declarations
This file contains hidden or 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
// Lato | |
$fonts-path: '../fonts/LatoLatin/fonts'; | |
// List of fonts used | |
// name_of_font: 'path_of_font' | |
// Please add only as many as you absolutely need | |
$font-list: ( | |
LatoLatin-Regular: 'LatoLatin-Regular', | |
LatoLatin-Bold: 'LatoLatin-Bold' | |
); | |
// This generates the @font-face code for each Roboto variation | |
// and uses the above map list of fonts | |
@each $fontname, $fontpath in $font-list { | |
@font-face { | |
font-family: '#{$fontname}'; | |
src: url('#{$fonts-path}/#{$fontpath}.eot'); | |
src: url('#{$fonts-path}/#{$fontpath}.eot?#iefix') format('embedded-opentype'), | |
url('#{$fonts-path}/#{$fontpath}.woff') format('woff'), | |
url('#{$fonts-path}/#{$fontpath}.ttf') format('truetype'), | |
url('#{$fonts-path}/#{$fontpath}.svg##{$fontname}') format('svg'); | |
font-weight: normal; | |
font-style: normal; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment