Skip to content

Instantly share code, notes, and snippets.

@kriswallsmith
Created July 20, 2010 22:30
Show Gist options
  • Save kriswallsmith/483701 to your computer and use it in GitHub Desktop.
Save kriswallsmith/483701 to your computer and use it in GitHub Desktop.
@mixin gradient($start, $end, $type: "vertical") {
@if "vertical" == $type {
background: -webkit-gradient(linear, left top, left bottom, from($start), to($end));
background: -moz-linear-gradient(top, $start, $end);
filter: progid:DXImageTransform.Microsoft.gradient(StartColorStr='#{$start}', EndColorStr='#{$end}');
} @else if "horizontal" == $type {
background: -webkit-gradient(linear, left top, right top, from($start), to($end));
background: -moz-linear-gradient(left, $start, $end);
filter: progid:DXImageTransform.Microsoft.gradient(StartColorStr='#{$start}', EndColorStr='#{$end}', GradientType=1);
} @else {
@warn "#{$type} is not a valid gradient type";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment