Skip to content

Instantly share code, notes, and snippets.

@Hubro
Created February 21, 2012 12:05
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 Hubro/1876138 to your computer and use it in GitHub Desktop.
Save Hubro/1876138 to your computer and use it in GitHub Desktop.
Shortcut function for top-down css gradients, written in stylus
// Shortcut for top-down gradient background color
td_gradient(color1, color2)
background-color (color1 + (color2 - color1) / 2)
background -webkit-gradient(linear, 0% 0%, 0% 100%, from(color1), to(color2))
background -webkit-linear-gradient(top, color1, color2)
background -moz-linear-gradient(top, color1, color2)
background -ms-linear-gradient(top, color1, color2)
background -o-linear-gradient(top, color1, color2)
@css
{
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=color1, endColorstr=color2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment