Created
September 10, 2012 18:08
-
-
Save iamjohnlong/3692623 to your computer and use it in GitHub Desktop.
LESS mixin for background with an image stacked on a gradient
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.img-grad( | |
@color: "#fff", | |
@bgimg: "..", | |
@pos: 50% 50%, | |
@repeat: repeat, | |
@begin: #fff, | |
@end: #000, | |
) { | |
/* browsers without support for multiple bgs */ | |
background: @color @bgimg @pos @repeat; | |
/* Webkit - oldest -> newer syntax */ | |
background: @bgimg @pos @repeat, -webkit-gradient(linear, 0 0, 100% 0, from(@begin), to(@end)); | |
background: @bgimg @pos @repeat, -webkit-linear-gradient(top, @begin, @end); | |
background: @bgimg @pos @repeat, -o-linear-gradient(top, @begin, @end); | |
background: @bgimg @pos @repeat, -moz-linear-gradient(top, @begin, @end); | |
background: @bgimg @pos @repeat, linear-gradient(top, @begin, @end); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment