Skip to content

Instantly share code, notes, and snippets.

@FernE97
Created May 24, 2012 17:42
Show Gist options
  • Save FernE97/2783013 to your computer and use it in GitHub Desktop.
Save FernE97/2783013 to your computer and use it in GitHub Desktop.
css: LESS Mixins
/*=LESS Mixins
---------------------------------------*/
/*=Helpers
-----------------------------*/
.clearfix {
*zoom: 1;
&:before, &:after {
content: ""; display: table;
}
&:after { clear: both; }
}
.opacity(@opacity: 80) {
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=@opacity)";
filter: alpha(opacity=@opacity);
opacity: @opacity / 100;
}
.center {
display: block;
margin-left: auto;
margin-right: auto;
}
// image replacement
.ir {
border:0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}
/*=CSS3 Mixins
-----------------------------*/
.border-radius(@radius: 5px) {
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
border-radius: @radius;
}
.box-shadow(@shadow: 0 1px 3px rgba(0,0,0,.25)) {
-webkit-box-shadow: @shadow;
-moz-box-shadow: @shadow;
box-shadow: @shadow;
}
.transition(@property:all, @duration:.3s, @function:ease) {
-webkit-transition: @property @duration @function;
-moz-transition: @property @duration @function;
-o-transition: @property @duration @function;
-ms-transition: @property @duration @function;
transition: @property @duration @function;
}
.linear-gradient(@pos:top, @color1:#fff, @color2:#ccc) {
background: -webkit-linear-gradient(@pos, @color1, @color2);
background: -moz-linear-gradient(@pos, @color1, @color2);
background: -o-linear-gradient(@pos, @color1, @color2);
background: -ms-linear-gradient(@pos, @color1, @color2);
background: linear-gradient(@pos, @color1 , @color2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment