///
/// Create a font face rule. Embedded OpenType, WOFF2, WOFF and TrueType
/// files are automatically sourced.
///
/// Source - https://gist.github.com/jonathantneal/d0460e5c2d5d7f9bc5e6
///
/// @author [Jonathan Neal](https://gist.github.com/jonathantneal/d0460e5c2d5d7f9bc5e6)
///
/// @param {String} $name - font name
/// @param {String} $path - path to font file
/// @param {String} $weight [null] - font-weight value
/// @param {String} $style [null] - font-style value
/// @param {String} $exts [eot woff ttf] - space separated list of font extenstions
///
@mixin wk-font-face($name, $path, $weight: null, $style: null, $exts: eot woff ttf) {
  $src: null;
  $extmods: (eot: '?');
  $formats: (otf: 'opentype', ttf: 'truetype');
  @each $ext in $exts {
    $extmod: if(map-has-key($extmods, $ext), $ext + map-get($extmods, $ext), $ext);
    $format: if(map-has-key($formats, $ext), map-get($formats, $ext), $ext);
    $src: append($src, url(quote($path + '.' + $extmod)) format(quote($format)), comma);
  }
  @font-face {
    font-family: quote($name);
    font-style: $style;
    font-weight: $weight;
    src: $src;
  }
}

// Mixin overridding the regular table-row-variant classes
@mixin wk-table-row-variant($state, $color) {
  // Exact selectors below required to override `.table-striped` and prevent
  // inheritance to nested tables.
  .table > tbody > tr.#{$state} {
      border: 1px solid $color;

    > td.#{$state},
    > th.#{$state},
      &.#{$state} > td,
      &.#{$state} > th {
        background-clip: padding-box;
        background-color: inherit;
        border-bottom: 1px solid $color;
        border-top: 1px solid $color;

        a {
          color: $color;
          &:hover {
            color: darken($color, 10%);
            text-decoration: none;
          }
        }
      }
  }

}


//maps a collection of items to classnames
@mixin map-to-class($map, $property, $sel, $divider: $sel) {
  #{$sel} {
    @each $k, $v in $map {
      @at-root .#{$divider}-#{$sel}-#{$k} {
        @if type-of($v) == map {
          @include map-to-class($v, $property, $k, $divider) {
            @content;
          }
        } @else {
          #{$property}: $v;
        }
      }
    }
  }
}

//take commonglyphs and override third party icons in things such as ui-grid
@mixin extend-icon($content) {
  &::after {
    font-family: "Axcess Common";
    font-size: 1rem;
    font-style: normal;
    content: $content;
  }
}

@mixin wk-loading-icon($icon, $size) {
  background: url($icon) no-repeat cover;
  width: $size;
  height: $size;
}

// Button sizes
@mixin icon-button-size($size) {
  font-size: $size/2;
  height: $size;
  line-height: $size;
  width: $size;
}

//easily add transitions to items
@mixin transition( $type: ease, $duration: .3s, $property: all) {
  transition: $property $duration $type;
}

@mixin rotate90(){
  /* Safari */
  -webkit-transform: rotate(90deg);

  /* Firefox */
  -moz-transform: rotate(90deg);

  /* IE */
  -ms-transform: rotate(90deg);

  /* Opera */
  -o-transform: rotate(90deg);

  /* Internet Explorer */
  filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=-3);
}

@mixin clearfix() {
  &:after {
    content: "";
    display: table;
    clear: both;
  }
}