Created
April 4, 2012 14:12
-
-
Save fleeting/2301398 to your computer and use it in GitHub Desktop.
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
/* Snippets */ | |
.clearfix { | |
*zoom: 1; | |
&:before, &:after { | |
display: table; | |
content: ""; | |
} | |
&:after { | |
clear: both; | |
} | |
} | |
.size(@height: 5px, @width: 5px) { | |
width: @width; | |
height: @height; | |
} | |
/* CSS3 Properties */ | |
.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; | |
} | |
.text-shadow(@x: 1px, @y: 1px, @blur: 2px, @color: #333) { | |
text-shadow: @x @y @blur @color; | |
filter: dropshadow(color=@color, offx=@x, offy=@y); | |
} | |
.transition(@transition) { | |
-webkit-transition: @transition; | |
-moz-transition: @transition; | |
-ms-transition: @transition; | |
-o-transition: @transition; | |
transition: @transition; | |
} | |
.rotate(@degrees) { | |
-webkit-transform: rotate(@degrees); | |
-moz-transform: rotate(@degrees); | |
-ms-transform: rotate(@degrees); | |
-o-transform: rotate(@degrees); | |
transform: rotate(@degrees); | |
} | |
.scale(@ratio) { | |
-webkit-transform: scale(@ratio); | |
-moz-transform: scale(@ratio); | |
-ms-transform: scale(@ratio); | |
-o-transform: scale(@ratio); | |
transform: scale(@ratio); | |
} | |
.translate(@x: 0, @y: 0) { | |
-webkit-transform: translate(@x, @y); | |
-moz-transform: translate(@x, @y); | |
-ms-transform: translate(@x, @y); | |
-o-transform: translate(@x, @y); | |
transform: translate(@x, @y); | |
} | |
.skew(@x: 0, @y: 0) { | |
-webkit-transform: skew(@x, @y); | |
-moz-transform: skew(@x, @y); | |
-ms-transform: skew(@x, @y); | |
-o-transform: skew(@x, @y); | |
transform: skew(@x, @y); | |
} | |
.translate3d(@x: 0, @y: 0, @z: 0) { | |
-webkit-transform: translate(@x, @y, @z); | |
-moz-transform: translate(@x, @y, @z); | |
-ms-transform: translate(@x, @y, @z); | |
-o-transform: translate(@x, @y, @z); | |
transform: translate(@x, @y, @z); | |
} | |
.background-clip(@clip) { | |
-webkit-background-clip: @clip; | |
-moz-background-clip: @clip; | |
background-clip: @clip; | |
} | |
.background-size(@size) { | |
-webkit-background-size: @size; | |
-moz-background-size: @size; | |
-o-background-size: @size; | |
background-size: @size; | |
} | |
.box-sizing(@boxmodel) { | |
-webkit-box-sizing: @boxmodel; | |
-moz-box-sizing: @boxmodel; | |
box-sizing: @boxmodel; | |
} | |
.user-select(@select) { | |
-webkit-user-select: @select; | |
-moz-user-select: @select; | |
-o-user-select: @select; | |
user-select: @select; | |
} | |
.resizable(@direction: both) { | |
resize: @direction; // Options: horizontal, vertical, both | |
overflow: auto; // Safari fix | |
} | |
.content-columns(@columnCount, @columnGap: @gridColumnGutter) { | |
-webkit-column-count: @columnCount; | |
-moz-column-count: @columnCount; | |
column-count: @columnCount; | |
-webkit-column-gap: @columnGap; | |
-moz-column-gap: @columnGap; | |
column-gap: @columnGap; | |
} | |
.opacity(@opacity: 100) { | |
opacity: @opacity / 100; | |
filter: e(%("alpha(opacity=%d)", @opacity)); | |
} | |
#gradient { | |
.horizontal(@startColor: #555, @endColor: #333) { | |
background-color: @endColor; | |
background-image: -moz-linear-gradient(left, @startColor, @endColor); // FF 3.6+ | |
background-image: -ms-linear-gradient(left, @startColor, @endColor); // IE10 | |
background-image: -webkit-gradient(linear, 0 0, 100% 0, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+ | |
background-image: -webkit-linear-gradient(left, @startColor, @endColor); // Safari 5.1+, Chrome 10+ | |
background-image: -o-linear-gradient(left, @startColor, @endColor); // Opera 11.10 | |
background-image: linear-gradient(left, @startColor, @endColor); // The standard | |
background-repeat: repeat-x; | |
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",@startColor,@endColor)); // IE9 and down | |
} | |
.vertical(@startColor: #555, @endColor: #333) { | |
background-color: mix(@startColor, @endColor, 60%); | |
background-image: -moz-linear-gradient(top, @startColor, @endColor); // FF 3.6+ | |
background-image: -ms-linear-gradient(top, @startColor, @endColor); // IE10 | |
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+ | |
background-image: -webkit-linear-gradient(top, @startColor, @endColor); // Safari 5.1+, Chrome 10+ | |
background-image: -o-linear-gradient(top, @startColor, @endColor); // Opera 11.10 | |
background-image: linear-gradient(top, @startColor, @endColor); // The standard | |
background-repeat: repeat-x; | |
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",@startColor,@endColor)); // IE9 and down | |
} | |
.directional(@startColor: #555, @endColor: #333, @deg: 45deg) { | |
background-color: @endColor; | |
background-repeat: repeat-x; | |
background-image: -moz-linear-gradient(@deg, @startColor, @endColor); // FF 3.6+ | |
background-image: -ms-linear-gradient(@deg, @startColor, @endColor); // IE10 | |
background-image: -webkit-linear-gradient(@deg, @startColor, @endColor); // Safari 5.1+, Chrome 10+ | |
background-image: -o-linear-gradient(@deg, @startColor, @endColor); // Opera 11.10 | |
background-image: linear-gradient(@deg, @startColor, @endColor); // The standard | |
} | |
.radial(@innerColor: #555, @outerColor: #333) { | |
background-color: @outerColor; | |
background-image: -webkit-gradient(radial, center center, 0, center center, 460, from(@innerColor), to(@outerColor)); | |
background-image: -webkit-radial-gradient(circle, @innerColor, @outerColor); | |
background-image: -moz-radial-gradient(circle, @innerColor, @outerColor); | |
background-image: -ms-radial-gradient(circle, @innerColor, @outerColor); | |
background-repeat: no-repeat; // Opera cannot do radial gradients yet | |
} | |
.striped(@color, @angle: -45deg) { | |
background-color: @color; | |
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, rgba(255,255,255,.15)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255,255,255,.15)), color-stop(.75, rgba(255,255,255,.15)), color-stop(.75, transparent), to(transparent)); | |
background-image: -webkit-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent); | |
background-image: -moz-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent); | |
background-image: -ms-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent); | |
background-image: -o-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent); | |
background-image: linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment