bratsun
10/11/2016 - 10:03 AM

Linear gradient mixin

Linear gradient mixin

@mixin linear-gradient($direction, $color-stops...) {
  // Direction has been omitted and happens to be a color-stop
  @if is-direction($direction) == false {
    $color-stops: $direction, $color-stops;
    $direction: 180deg;
  }
  background: nth(nth($color-stops, 1), 1);
  background: -webkit-linear-gradient($direction, $color-stops);
  background: linear-gradient($direction, $color-stops);
}