Skip to content

Instantly share code, notes, and snippets.

@collingo
Created February 9, 2012 23:16
Show Gist options
  • Save collingo/1784172 to your computer and use it in GitHub Desktop.
Save collingo/1784172 to your computer and use it in GitHub Desktop.
LESS Gradient Mixin
.twoStopGrad(@one, @two) {
background: @one; /* Old browsers */
background: -moz-linear-gradient(top, @one 0%, @two 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,@one), color-stop(100%,@two)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, @one 0%,@two 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, @one 0%,@two 100%); /* Opera11.10+ */
background: -ms-linear-gradient(top, @one 0%,@two 100%); /* IE10+ */
filter: ~"progid:DXImageTransform.Microsoft.gradient( startColorstr='@one', endColorstr='@two',GradientType=0 )"; /* IE6-9 */
background: linear-gradient(top, @one 0%,@two 100%); /* W3C */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment