////
/// @group Icons
////



// Generated by grunt-webfont



$typography-icons-no-cache: random(999999999);

/// Base path for loading font files
/// Override this in your application if your path differs.
/// E.g. if you want to replace it off a CDN you could change this to 'http://cdn.com/fonts/'
$nice-font-base-path: '/fonts/' !default;

@font-face {
  font-family: "NICE Icons";
  font-style: normal;
  font-weight: normal;
  src: url($nice-font-base-path + "nice-icons.eot?" + $typography-icons-no-cache);
  src: url($nice-font-base-path + "nice-icons.eot?#iefix") format("embedded-opentype"),
		url($nice-font-base-path + "nice-icons.woff2?" + $typography-icons-no-cache) format("woff2"),
		url($nice-font-base-path + "nice-icons.woff?" + $typography-icons-no-cache) format("woff"),
		url($nice-font-base-path + "nice-icons.ttf?" + $typography-icons-no-cache) format("truetype"),
		url($nice-font-base-path + "nice-icons.svg?" + $typography-icons-no-cache + "#typography-icons") format("svg");
}

/// Map of icon name to codepoint.
/// This map avoids the use of 'magic strings' for codepoints throught SASS code. The map is usually not used directly - use the nice-icon function/mixin instead.
/// Please note - the values for codepoints are not fixed and may change each time the font is re-generated.
/// @prop {string} evidence [f101] - <span class="icon icon--evidence" aria-hidden="true"></span>
/// @prop {string} facebook-square [f102] - <span class="icon icon--facebook-square" aria-hidden="true"></span>
/// @prop {string} guidance [f103] - <span class="icon icon--guidance" aria-hidden="true"></span>
/// @prop {string} linkedin-square [f104] - <span class="icon icon--linkedin-square" aria-hidden="true"></span>
/// @prop {string} logo-name [f105] - <span class="icon icon--logo-name" aria-hidden="true"></span>
/// @prop {string} logo [f106] - <span class="icon icon--logo" aria-hidden="true"></span>
/// @prop {string} pathways [f107] - <span class="icon icon--pathways" aria-hidden="true"></span>
/// @prop {string} standards [f108] - <span class="icon icon--standards" aria-hidden="true"></span>
/// @prop {string} syndication [f109] - <span class="icon icon--syndication" aria-hidden="true"></span>
/// @prop {string} twitter-square [f10a] - <span class="icon icon--twitter-square" aria-hidden="true"></span>
/// @prop {string} youtube-square [f10b] - <span class="icon icon--youtube-square" aria-hidden="true"></span>

$nice-icons: (
  evidence: "f101",
  facebook-square: "f102",
  guidance: "f103",
  linkedin-square: "f104",
  logo-name: "f105",
  logo: "f106",
  pathways: "f107",
  standards: "f108",
  syndication: "f109",
  twitter-square: "f10a",
  youtube-square: "f10b"
) !default;

/// Base styles required for an icon including font family etc
/// @example
///   .test {
///     @icnlude icon-base;
///
///     &:before {
///       content: nice-icon(search);
///     }
///   }
@mixin icon-base {
  display: inline-block;
  font-family: 'NICE Icons';
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  speak: none;
  text-decoration: inherit;
  text-rendering: auto;
  text-transform: none;
  vertical-align: baseline;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/// Applies the required styles for the given icon
/// including the codepoint.
/// @param {string} $icon - The name of the icon
/// @throws Error when the given icon doesn't exist
/// @example
///   .search-icon {
///     @include nice-icon(search);
///   }
@mixin nice-icon($icon) {
  @if map-has-key($nice-icons, $icon) {
    @include icon-base;
    content: nice-icon($icon);
  } @else {
    @error 'Icons with name #{ $icon } could not be found in the $nice-icons map';
  }
}

/// Function for getting the codepoint for a given icon, for use
/// within the `content` property of psuedo elements.
/// @example
///   .test {
///     @icnlude icon-base;
///
///     &:before {
///       content: nice-icon(search);
///     }
///   }
@function nice-icon($icon) {
  @if map-has-key($nice-icons, $icon) {
    $icon-code: map-get($nice-icons, $icon);
    @return unquote('\'\\#{ $icon-code }\'');
  } @else {
    @error 'Icons with name #{ $icon } could not be found in the $nice-icons map';
  }
}

/// Class for rendering an icon.
/// Use with a named modifier for an icon.
/// @example
///   <span class="icon icon--search" aria-hidden="true"></span>
.icon {
  @include icon-base;

  &:before {
    display: block;
  }

  @each $icon, $code in $nice-icons {
    &--#{ $icon }:before {
      content: nice-icon($icon);
    }
  }
}
