Skip to content

Instantly share code, notes, and snippets.

@spint
Created February 23, 2011 14:43
Show Gist options
  • Save spint/840497 to your computer and use it in GitHub Desktop.
Save spint/840497 to your computer and use it in GitHub Desktop.
Cross-browser background gradient
// source: http://shaneriley.tumblr.com/post/3462508768/a-sass-mixin-for-cross-browser-css-background-gradients
= gradient-bg($color1, $color2)
background-color: $color2
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#{$color1}, endColorstr=#{$color2})
background-image: -moz-linear-gradient(center top, $color1, $color2)
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from($color1), to($color2))
background-repeat: no-repeat
#container
+gradient-bg(#ffffff, #ececec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment