/ Published in: CSS
Mixins for your mixing pleasure
Expand |
Embed | Plain Text
/* Image replacements */ .ir { display: block; text-indent: -999em; overflow: hidden; background-repeat: no-repeat; text-align: left; direction: ltr; } .hidden { display: none; visibility: hidden; } .visuallyhidden { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; } .visuallyhidden.focusable:active, .visuallyhidden.focusable:focus { clip: auto; height: auto; margin: 0; overflow: visible; position: static; width: auto; } .invisible { visibility: hidden; } .clearfix:before, .clearfix:after { content: "\0020"; display: block; height: 0; overflow: hidden; } .clearfix:after { clear: both; } .clearfix { zoom: 1; } .float-left { float:left; } .float-right { float:right; } .clear { clear:both; } .clear-left { clear: left; } .clear-left { clear: right; } .clearmix { :after { content: "\0020"; display: block; height: 0; overflow: hidden; clear: both; } :before { content: "\0020"; display: block; height: 0; overflow: hidden; } zoom: 1; } .inline-block { display: -moz-inline-stack; display: inline-block; vertical-align: top; zoom: 1; *display: inline; } .pie { behavior: url('/PATH-TO-PIE/PIE/PIE.htc'); } // IE fixes /*Border Radius Functions*/ .border_radius(@radius_top_left, @radius_top_right, @radius_bottom_right, @radius_bottom_left) { -webkit-border-radius:@radius_top_left @radius_top_right @radius_bottom_right @radius_bottom_left; -moz-border-radius:@radius_top_left @radius_top_right @radius_bottom_right @radius_bottom_left; border-radius:@radius_top_left @radius_top_right @radius_bottom_right @radius_bottom_left; .pie; } /*Shadows*/ .box_shadow(@shadow_x:3px, @shadow_y:3px, @shadow_rad:3px, @shadow_color:#888) { box-shadow: @shadow_x @shadow_y @shadow_rad @shadow_color; -webkit-box-shadow:@shadow_x @shadow_y @shadow_rad @shadow_color; -moz-box-shadow:@shadow_x @shadow_y @shadow_rad @shadow_color; .pie; } .text_shadow(@shadow_color:#fff) { text-shadow:0 1px 0 @shadow_color; .pie; } .opacity(@op:100) { filter:alpha(opacity=@op); -moz-opacity:@op/100; -khtml-opacity:@op/100; opacity:@op/100; .pie; } .background_gradient(@from:#000, @to:#EEE) { background: @from; background-image: -webkit-gradient(linear, left top, left bottom, from(@from), to(@to)); background-image: -moz-linear-gradient(top, @from, @to); filter: formatstring("progid:DXImageTransform.Microsoft.gradient(startColorstr='{0}', endColorstr='{1}')", @from, @to); /* IE6,IE7 */ -ms-filter: formatstring("\"progid:DXImageTransform.Microsoft.gradient(startColorStr='{0}', EndColorStr='{1}')\"", @from, @to); /* IE8 */ /*.pie;*/ } .transition(@range: all, @time: 1s, @ease: ease-in-out) { -moz-transition: @range @time @ease; -webkit-transition: @range @time @ease; -o-transition: @range @time @ease; transition: @range @time @ease; } /*Transformations*/ .skew(@angle_x:35, @angle_y:0) { -webkit-transform: skew(formatstring("{0}deg", @angle_x), formatstring("{0}deg", @angle_y)); -moz-transform: skew(formatstring("{0}deg", @angle_x), formatstring("{0}deg", @angle_y)); -o-transform: skew(formatstring("{0}deg", @angle_x), formatstring("{0}deg", @angle_y)); -ms-transform: skew(formatstring("{0}deg", @angle_x), formatstring("{0}deg", @angle_y)); transform: skew(formatstring("{0}deg", @angle_x), formatstring("{0}deg", @angle_y)); } .scale(@scale_x: 1) { -webkit-transform: scale(@scale_x); -moz-transform: scale(@scale_x); -o-transform: scale(@scale_x); -ms-transform: scale(@scale_x); transform: scale(@scale_x); } .rotate(@deg:35) { -webkit-transform: rotate(formatstring("{0}deg", @deg)); -moz-transform: rotate(formatstring("{0}deg", @deg)); -o-transform: rotate(formatstring("{0}deg", @deg)); -ms-transform: rotate(formatstring("{0}deg", @deg)); transform: rotate(formatstring("{0}deg", @deg)); } .translate(@move_x: 10px, @move_y: 10px) { -webkit-transform: translate(@move_x, @move_y); -moz-transform: translate(@move_x, @move_y); -o-transform: translate(@move_x, @move_y); -ms-transform:translate(@move_x, @move_y); transform: translate(@move_x, @move_y); }
You need to login to post a comment.
