Last active
January 25, 2016 16:11
-
-
Save wutupake/7cde1eeb1a7295cfa7ca to your computer and use it in GitHub Desktop.
[SCSS] Font embedding dynamic generator (created with @Lanfre)
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
// My fonts | |
$fontPath: '/fonts/path/'; | |
$fonts: ( | |
'Bold': 'SansWeb-Bold', | |
'BoldItalic': 'SansWeb-BoldItalic', | |
'Heavy': 'SansWeb-Heavy', | |
'HeavyItalic': 'SansWeb-HeavyItalic', | |
'Italic': 'SansWeb-Italic', | |
'Light': 'SansWeb-Light', | |
'LightItalic': 'SansWeb-LightItalic', | |
'Medium': 'SansWeb-Medium', | |
'MediumItalic': 'SansWeb-MediumItalic', | |
'Regular': 'SansWeb-Regular', | |
'Thin': 'SansWeb-Thin', | |
'ThinItalic': 'SansWeb-ThinItalic' | |
); | |
@each $name, $fileName in $fonts { | |
@font-face { | |
font-family: $name; | |
src: url( $fontPath + $fileName + '/' + $fileName + '.woff2' ) format('woff2'), | |
url( $fontPath + $fileName + '/' + $fileName + '.woff' ) format('woff'); | |
font-weight: normal; | |
font-style: normal; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment