Skip to content

Instantly share code, notes, and snippets.

@wutupake
Last active January 25, 2016 16:11
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 wutupake/7cde1eeb1a7295cfa7ca to your computer and use it in GitHub Desktop.
Save wutupake/7cde1eeb1a7295cfa7ca to your computer and use it in GitHub Desktop.
[SCSS] Font embedding dynamic generator (created with @Lanfre)
// 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