Skip to content

Instantly share code, notes, and snippets.

@bratsun
Created October 11, 2016 10:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bratsun/5f4190a12dab03e477f987c1ac9c6d48 to your computer and use it in GitHub Desktop.
Save bratsun/5f4190a12dab03e477f987c1ac9c6d48 to your computer and use it in GitHub Desktop.
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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment