DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Lance has posted 24 posts at DZone. View Full User Profile

Cross Browser CSS Gradients With Sass

08.11.2010
| 7366 views |
  • submit to reddit
        
@mixin gradient($first, $second) {
  background: $second;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='$first', endColorstr='$second');
  background: -webkit-gradient(linear, left top, left bottom, from($first), to($second));
  background: -moz-linear-gradient(top,  $first,  $second);
}

.gradient {
  @include gradient(black, white);
}