Skip to content

Instantly share code, notes, and snippets.

@allanwhite
Last active August 29, 2015 14:20
Show Gist options
  • Save allanwhite/931c4adb5edc813bf0a6 to your computer and use it in GitHub Desktop.
Save allanwhite/931c4adb5edc813bf0a6 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
- var fontlist = [{name: 'Black', style: 'normal', weight: 900},{name: 'BlackItalic', style: 'italic', weight: 900},{name: 'Heavy', style: 'normal', weight: 800},{name: 'HeavyItalic', style: 'italic', weight: 800},{name: 'Bold', style: 'normal', weight: 700},{name: 'BoldItalic', style: 'italic', weight: 700},{name: 'Semibold', style: 'normal', weight: 600},{name: 'SemiboldItalic', style: 'italic', weight: 600},{name: 'Medium', style: 'normal', weight: 500},{name: 'MediumItalic', style: 'italic', weight: 500},{name: 'Regular', style: 'normal', weight: 400},{name: 'Italic', style: 'italic', weight: 400},{name: 'Light', style: 'normal', weight: 300},{name: 'LightItalic', style: 'italic', weight: 300},{name: 'Thin', style: 'normal', weight: 100},{name: 'ThinItalic', style: 'italic', weight: 100},{name: 'Hairline', style: 'normal', weight: 100},{name: 'HairlineItalic', style: 'italic', weight: 100}]
each font, n in fontlist
p(class='Lato-'+fontlist[n].name) #{fontlist[n].name} #{fontlist[n].weight}
// ----
// Sass (v3.4.13)
// Compass (v1.0.3)
// ----
$font-list-lato:
"Black" normal 900, "BlackItalic" italic 900, "Heavy" normal 800, "HeavyItalic" italic 800, "Bold" normal 700, "BoldItalic" italic 700, "Semibold" normal 600, "SemiboldItalic" italic 600, "Medium" normal 500, "MediumItalic" italic 500, "Regular" normal 400, "Italic" italic 400, "Light" normal 300, "LightItalic" italic 300, "Thin" normal 100, "ThinItalic" italic 100, "Hairline" normal 100, "HairlineItalic" italic 100;
@each $font, $style, $weight in $font-list-lato{
@font-face {
font-family: 'Lato#{$font}';
src: url('Lato-#{$font}.eot');
src: url('Lato-#{$font}?#iefix') format('embedded-opentype'),
url('Lato-#{$font}.woff') format('woff'),
url('Lato-#{$font}.ttf') format('truetype');
font-style: $style;
font-weight: $weight;
text-rendering: optimizeLegibility;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment