// Follows Google Fonts Naming Convention with Font Squirrel generation
// Font Specification: Weight, Code, Italic

$typefaces: (
        'Example': (
                        ('thin', 100, true),
                        ('extralight', 200, true),
                        ('light', 300, true),
                        ('regular', 400, true),
                        ('medium', 500, true),
                        ('semibold', 600, true),
                        ('bold', 700, true),
                        ('extrabold', 800, true),
                        ('black', 900, true),
        ),
);

@each $name, $typeface in $typefaces {
  @each $font in $typeface {
    $path_prefix: '../fonts/#{$name}/#{to-lower-case($name)}';
    @font-face {
      font-family: $name;
      src: url('#{$path_prefix}-#{nth($font, 1)}.woff2') format('woff2'),
      url('#{$path_prefix}-#{nth($font, 1)}.woff') format('woff');
      font-weight: nth($font, 2);
      font-style: normal;
    }
    @if (nth($font, 3)) {
      @font-face {
        font-family: $name;
        src: url('#{$path_prefix}-#{nth($font, 1)}italic.woff2') format('woff2'),
        url('#{$path_prefix}-#{nth($font, 1)}italic.woff') format('woff');
        font-weight: nth($font, 2);
        font-style: italic;
      }
    }
  }
}