Skip to content

Instantly share code, notes, and snippets.

@razwan
Created December 2, 2015 13:14
Show Gist options
  • Save razwan/5843d912eee0046199e2 to your computer and use it in GitHub Desktop.
Save razwan/5843d912eee0046199e2 to your computer and use it in GitHub Desktop.
Typography Prototype
@mixin font-face($name, $filename, $weight: regular) {
@font-face {
font-family: $name;
font-wight: $weight;
src: url(unquote($filename) + '.eot'); /* IE9 Compat Modes */
src: url(unquote($filename) + '.woff2') format('woff2'), /* Super Modern Browsers */
url(unquote($filename) + '.woff') format('woff'), /* Pretty Modern Browsers */
url(unquote($filename) + '.ttf') format('truetype'), /* Safari, Android, iOS */
url(unquote($filename) + '.svg#svgFontName') format('svg'); /* Legacy iOS */
}
}
@include font-face('Montserrat', 'Montserrat');
@include font-face('Montserrat', 'Montserrat-Bold', 800);
$font-family--default: 'MyWebFont';
%font-family--default { font-family: $font-family--default; }
%font-weight--bolder { font-weight: 800; }
%font-weight--bold { font-weight: 600; }
.findmenow {
@extend %font-family--default;
@extend %font-weight--bolder;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment