Skip to content

Instantly share code, notes, and snippets.

@jackreichert
Created August 30, 2011 17:54
Show Gist options
  • Save jackreichert/1181518 to your computer and use it in GitHub Desktop.
Save jackreichert/1181518 to your computer and use it in GitHub Desktop.
LessCSS Gradients (including ms-filter)
.gradient(@from: #cfe0ec, @to: #d1e4ef) {
background-color: @from;
background-image: -webkit-linear-gradient(top, @from, @to);
background-image: -moz-linear-gradient(top, @from, @to);
background-image: -ms-linear-gradient(top, @from, @to);
background-image: -o-linear-gradient(top, @from, @to);
filter: ~"progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=@{from}, endColorstr=@{to})";
-ms-filter: ~"'progid:DXImageTransform.Microsoft.gradient (GradientType=0, startColorstr=@{from}, endColorstr=@{to})'";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment