////////////////////////////////////////////
// From Jina Bolton and Eric Meyer -- http://codepen.io/jina/pen/iosjp
@function cs-stripes($position, $colors) {
  $colors: if(type-of($colors) != 'list', compact($colors), $colors);
  $gradient: ();
  $width: 100% / length($colors);

  @for $i from 1 through length($colors) {
    $pop: nth($colors,$i);
    $new: $pop ($width * ($i - 1)), $pop ($width * $i);
    $gradient: join($gradient, $new, comma);
  }

  @return linear-gradient($position, $gradient);
}

////////////////////////////////////////////
// Color tester

@mixin cs-test($colors, $height: 2em, $element: "body:before") {
  #{$element} {
    content: "";
    display: block;
    height: $height;
    @include background(cs-stripes(left, ($colors)));
    position: relative;
    z-index: 999999999999;
  }
}
