Skip to content

Instantly share code, notes, and snippets.

@hileon
Created March 27, 2012 03:49
Show Gist options
  • Save hileon/2212345 to your computer and use it in GitHub Desktop.
Save hileon/2212345 to your computer and use it in GitHub Desktop.
LESSCSS CSS3 Mixins
///*---------------------------------------------------------------------*/
.mixin-border-radius(@topleft:5px,@topright:5px,@bottomright:5px,@bottomleft:5px) {
border-top-left-radius: @topleft;
border-top-right-radius: @topright;
border-bottom-right-radius: @bottomright;
border-bottom-left-radius: @bottomleft;
-moz-border-radius-topleft: @topleft;
-moz-border-radius-topright: @topright;
-moz-border-radius-bottomright: @bottomright;
-moz-border-radius-bottomleft: @bottomleft;
-webkit-border-top-left-radius: @topleft;
-webkit-border-top-right-radius: @topright;
-webkit-border-bottom-right-radius: @bottomright;
-webkit-border-bottom-left-radius: @bottomleft;
}
///*---------------------------------------------------------------------*/
.mixin-box-shadow-one(@first) {
-webkit-box-shadow:@first;
-moz-box-shadow:@first;
box-shadow:@first;
}
///*---------------------------------------------------------------------*/
.mixin-box-shadow-two(@first, @second) {
-webkit-box-shadow:@first,@second;
-moz-box-shadow:@first,@second;
box-shadow:@first,@second;
}
///*---------------------------------------------------------------------*/
.mixin-transition(@property,@delay:.5s,@easing:ease-in-out) {
-webkit-transition:@property @delay @easing;
-moz-transition:@property @delay @easing;
-o-transition:@property @delay @easing;
-ms-transition:@property @delay @easing;
transition:@property @delay @easing;
}
///*---------------------------------------------------------------------*/
.mixin background-gradient(@top_color:#fff,@bottom_color:#e6e6e6) {
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@top_color), color-stop(25%, @top_color), to(@bottom_color));
background-image: -webkit-linear-gradient(@top_color, @top_color 25%, @bottom_color);
background-image: -moz-linear-gradient(top, @top_color, @top_color 25%, @bottom_color);
background-image: -ms-linear-gradient(@top_color, @top_color 25%, @bottom_color);
background-image: -o-linear-gradient(@top_color, @top_color 25%, @bottom_color);
background-image: linear-gradient(@top_color, @top_color 25%, @bottom_color);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{@top_color}', endColorstr='#{@bottom_color}', GradientType=0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment