/**
 * Mixin to import an icomoon set easily.
 *
 * This will add the font-face as needed and bootstrap all
 * provided icons and their content, without redifinition.
 */
@mixin icomoon ($name, $path, $icons) {
  @font-face {
    font-family: "#{$name}";
    src:  url("#{$path}.eot");
    src:  url("#{$path}.eot#iefix") format('embedded-opentype'),
          url("#{$path}.ttf") format('truetype'),
          url("#{$path}.woff") format('woff'),
          url("#{$path}.svg#icomoon") format('svg');
    font-weight: normal;
    font-style: normal;
  }

  %icomoon-opts {
    // use !important to prevent issues with extensions
    font-family: "#{$name}" !important;
    speak: none;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;

    // better font rendering
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  @each $icon, $content in $icons {
    .icon-#{$icon} {
      // extend options
      @extend %icomoon-opts;

      // add content
      &:before {
        content: $content;
      }
    }
  }
}
