Skip to content

Instantly share code, notes, and snippets.

@jenofdoom
Created February 11, 2015 22:14
Show Gist options
  • Save jenofdoom/d41434f5d088bb64a1cf to your computer and use it in GitHub Desktop.
Save jenofdoom/d41434f5d088bb64a1cf to your computer and use it in GitHub Desktop.
less-font-squirrel-mixin
// font families!
.font-face(@fontname; @filename: @fontname; @weight: normal; @style: normal) {
// based on font squirrel output, without SVG (too legacy)
@font-face {
font-family: @fontname;
src:url('../fonts/@{filename}.eot');
src:url('../fonts/@{filename}.eot?#iefix') format('embedded-opentype'),
url('../fonts/@{filename}.woff2') format('woff2'),
url('../fonts/@{filename}.woff') format('woff'),
url('../fonts/@{filename}.ttf') format('truetype');
font-weight: @weight;
font-style: @style;
}
}
// FONTS
.font-face('Lato'; 'lato-regular-webfont');
.font-face('Lato'; 'lato-italic-webfont'; normal; italic);
.font-face('Lato'; 'lato-light-webfont'; 300);
.font-face('Lato'; 'lato-lightitalic-webfont'; 300; italic);
.font-face('Lato'; 'lato-hairline-webfont'; 100);
.font-face('Lato'; 'lato-hairlineitalic-webfont'; 100; italic);
.font-face('Lato'; 'lato-bold-webfont'; 700);
.font-face('Lato'; 'lato-bolditalic-webfont'; 700; italic);
.font-face('Lato'; 'lato-black-webfont'; 900);
.font-face('Lato'; 'lato-blackitalic-webfont'; 900; italic);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment