// SCSS variables are information about icon's compiled state, stored under its original file name
//
// .icon-home {
//   width: $icon-home-width;
// }
//
// The large array-like variables contain all information about a single icon
// $icon-home: x y offset_x offset_y width height total_width total_height image_path;
//
// At the bottom of this section, we provide information about the spritesheet itself
// $spritesheet: width height image $spritesheet-sprites;
$alert-icon-red-name: 'alert-icon-red';
$alert-icon-red-x: 24px;
$alert-icon-red-y: 0px;
$alert-icon-red-offset-x: -24px;
$alert-icon-red-offset-y: 0px;
$alert-icon-red-width: 16px;
$alert-icon-red-height: 16px;
$alert-icon-red-total-width: 57px;
$alert-icon-red-total-height: 55px;
$alert-icon-red-image: '/project/images/sprite.png';
$alert-icon-red: (24px, 0px, -24px, 0px, 16px, 16px, 57px, 55px, '/project/images/sprite.png', 'alert-icon-red', );
$back-icon-name: 'back-icon';
$back-icon-x: 0px;
$back-icon-y: 24px;
$back-icon-offset-x: 0px;
$back-icon-offset-y: -24px;
$back-icon-width: 16px;
$back-icon-height: 16px;
$back-icon-total-width: 57px;
$back-icon-total-height: 55px;
$back-icon-image: '/project/images/sprite.png';
$back-icon: (0px, 24px, 0px, -24px, 16px, 16px, 57px, 55px, '/project/images/sprite.png', 'back-icon', );
$close-icon-dark-name: 'close-icon-dark';
$close-icon-dark-x: 21px;
$close-icon-dark-y: 24px;
$close-icon-dark-offset-x: -21px;
$close-icon-dark-offset-y: -24px;
$close-icon-dark-width: 12px;
$close-icon-dark-height: 12px;
$close-icon-dark-total-width: 57px;
$close-icon-dark-total-height: 55px;
$close-icon-dark-image: '/project/images/sprite.png';
$close-icon-dark: (21px, 24px, -21px, -24px, 12px, 12px, 57px, 55px, '/project/images/sprite.png', 'close-icon-dark', );
$close-icon-name: 'close-icon';
$close-icon-x: 45px;
$close-icon-y: 0px;
$close-icon-offset-x: -45px;
$close-icon-offset-y: 0px;
$close-icon-width: 12px;
$close-icon-height: 12px;
$close-icon-total-width: 57px;
$close-icon-total-height: 55px;
$close-icon-image: '/project/images/sprite.png';
$close-icon: (45px, 0px, -45px, 0px, 12px, 12px, 57px, 55px, '/project/images/sprite.png', 'close-icon', );
$heart-icon-white-name: 'heart-icon-white';
$heart-icon-white-x: 45px;
$heart-icon-white-y: 17px;
$heart-icon-white-offset-x: -45px;
$heart-icon-white-offset-y: -17px;
$heart-icon-white-width: 12px;
$heart-icon-white-height: 11px;
$heart-icon-white-total-width: 57px;
$heart-icon-white-total-height: 55px;
$heart-icon-white-image: '/project/images/sprite.png';
$heart-icon-white: (45px, 17px, -45px, -17px, 12px, 11px, 57px, 55px, '/project/images/sprite.png', 'heart-icon-white', );
$plus-icon-white-name: 'plus-icon-white';
$plus-icon-white-x: 0px;
$plus-icon-white-y: 45px;
$plus-icon-white-offset-x: 0px;
$plus-icon-white-offset-y: -45px;
$plus-icon-white-width: 10px;
$plus-icon-white-height: 10px;
$plus-icon-white-total-width: 57px;
$plus-icon-white-total-height: 55px;
$plus-icon-white-image: '/project/images/sprite.png';
$plus-icon-white: (0px, 45px, 0px, -45px, 10px, 10px, 57px, 55px, '/project/images/sprite.png', 'plus-icon-white', );
$search-icon-name: 'search-icon';
$search-icon-x: 0px;
$search-icon-y: 0px;
$search-icon-offset-x: 0px;
$search-icon-offset-y: 0px;
$search-icon-width: 19px;
$search-icon-height: 19px;
$search-icon-total-width: 57px;
$search-icon-total-height: 55px;
$search-icon-image: '/project/images/sprite.png';
$search-icon: (0px, 0px, 0px, 0px, 19px, 19px, 57px, 55px, '/project/images/sprite.png', 'search-icon', );
$spritesheet-width: 57px;
$spritesheet-height: 55px;
$spritesheet-image: '/project/images/sprite.png';
$spritesheet-sprites: ($alert-icon-red, $back-icon, $close-icon-dark, $close-icon, $heart-icon-white, $plus-icon-white, $search-icon, );
$spritesheet: (57px, 55px, '/project/images/sprite.png', $spritesheet-sprites, );

// The provided mixins are intended to be used with the array-like variables
//
// .icon-home {
//   @include sprite-width($icon-home);
// }
//
// .icon-email {
//   @include sprite($icon-email);
// }
//
// Example usage in HTML:
//
// `display: block` sprite:
// <div class="icon-home"></div>
//
// To change `display` (e.g. `display: inline-block;`), we suggest using a common CSS class:
//
// // CSS
// .icon {
//   display: inline-block;
// }
//
// // HTML
// <i class="icon icon-home"></i>
@mixin sprite-width($sprite) {
  width: nth($sprite, 5);
}

@mixin sprite-height($sprite) {
  height: nth($sprite, 6);
}

@mixin sprite-position($sprite) {
  $sprite-offset-x: nth($sprite, 3);
  $sprite-offset-y: nth($sprite, 4);
  background-position: $sprite-offset-x  $sprite-offset-y;
}

@mixin sprite-image($sprite) {
  $sprite-image: nth($sprite, 9);
  background-image: url(#{$sprite-image});
}

@mixin sprite($sprite) {
  @include sprite-image($sprite);
  @include sprite-position($sprite);
  @include sprite-width($sprite);
  @include sprite-height($sprite);
}

// The `sprites` mixin generates identical output to the CSS template
//   but can be overridden inside of SCSS
//
// @include sprites($spritesheet-sprites);
@mixin sprites($sprites) {
  @each $sprite in $sprites {
    $sprite-name: nth($sprite, 10);
    .#{$sprite-name} {
      @include sprite($sprite);
    }
  }
}
