// Border Radius Functions .border-radius(@radius: 10px) { .border-radius2(@radius, @radius); } .border-radius2(@radius_top, @radius_bottom) { .border-radius4(@radius_top, @radius_top, @radius_bottom, @radius_bottom); } .border-radius4(@radius_top_left, @radius_top_right, @radius_bottom_right, @radius_bottom_left) { border-radius: @arguments; } .border-radius-top-left(@radius) { border-top-left-radius: @radius; } .border-radius-top-right(@radius) { border-top-right-radius: @radius; } .border-radius-bottom-left(@radius) { border-bottom-left-radius: @radius; } .border-radius-bottom-right(@radius) { border-bottom-right-radius: @radius; } // Shadows .box-shadow(@none) { box-shadow: none; -webkit-box-shadow: none; } .box-shadow(@shadow_x, @shadow_y, @shadow_rad, @shadow_color) { box-shadow: @arguments; -webkit-box-shadow: @arguments; } .box-shadow(@shadow_x, @shadow_y, @shadow_rad, @shadow_spread, @shadow_color) { box-shadow: @arguments; -webkit-box-shadow: @arguments; } .box-shadow(@inset, @shadow_x, @shadow_y, @shadow_rad, @shadow_blur, @shadow_color) { box-shadow: @arguments; -webkit-box-shadow: @arguments; } .box-shadow(@shadow_x, @shadow_y, @shadow_rad, @shadow_color, @shadow_x2, @shadow_y2, @shadow_rad2, @shadow_color2) { box-shadow: @shadow_x @shadow_y @shadow_rad @shadow_color, @shadow_x2 @shadow_y2 @shadow_rad2 @shadow_color2; -webkit-box-shadow: @shadow_x @shadow_y @shadow_rad @shadow_color, @shadow_x2 @shadow_y2 @shadow_rad2 @shadow_color2; } //opacity .opacity(@op:100) { filter: alpha(opacity= @op); opacity: @op/100; } // Gradients .linear-gradient(@from, @to) { .linear-gradient(@from, @to, @from); } .linear-gradient(@from, @to, @failover) { .linear-gradient-no-filter(@from, @to, @failover); } .linear-gradient-no-filter(@from, @to) { .linear-gradient-no-filter(@from, @to, @from); } .linear-gradient-no-filter(@from, @to, @failover) { .linear-gradient-2-stop(@from, 0%, @to, 100%, @failover); } .linear-gradient-filter(@from, @to) { filter: ~"progid:DXImageTransform.Microsoft.gradient(startColorstr='@{from}', endColorstr='@{to}', GradientType=0)"; // IE6-9 } .linear-gradient-failover(@failover) { background: @failover; // Old browsers } .linear-gradient-2-stop(@from, @from_stop, @to, @to_stop) { .linear-gradient-2-stop(@from, @from_stop, @to, @to_stop, @from); } .linear-gradient-2-stop(@from, @from_stop, @to, @to_stop, @failover) { .linear-gradient-failover(@failover); background: -moz-linear-gradient(top, @from @from_stop, @to @to_stop); // FF3.6+ background: -webkit-gradient(linear, left top, left bottom, color-stop(@from_stop,@from), color-stop(@to_stop,@to)); // Chrome, Safari4+ background: -webkit-linear-gradient(top, @from @from_stop,@to @to_stop); // Chrome10+, Safari5.1+ background: -o-linear-gradient(top, @from @from_stop,@to @to_stop); // Opera 11.10+ background: -ms-linear-gradient(top, @from @from_stop,@to @to_stop); // IE10+ background: linear-gradient(to bottom, @from @from_stop,@to @to_stop); // W3C } .repeating-linear-gradient(@angle, @color_stop1, @color_stop2, @color_stop3, @color_stop4) { background: -webkit-repeating-linear-gradient(@angle, @color_stop1, @color_stop2, @color_stop3, @color_stop4); background: -moz-repeating-linear-gradient(@angle, @color_stop1, @color_stop2, @color_stop3, @color_stop4); background: -ms-repeating-linear-gradient(@angle, @color_stop1, @color_stop2, @color_stop3, @color_stop4); background: -o-repeating-linear-gradient(@angle, @color_stop1, @color_stop2, @color_stop3, @color_stop4); background: repeating-linear-gradient(@angle, @color_stop1, @color_stop2, @color_stop3, @color_stop4); } // Box Flex .box-flex-display() { display: -webkit-box; display: -moz-box; display: box; } .box-flex(@flex:1) { -webkit-box-flex: @flex; -moz-box-flex: @flex; box-flex: @flex; } // Box-Sizing .box-sizing(@display) { -webkit-box-sizing: @display; -moz-box-sizing: @display; box-sizing: @display; } .background-clip(@r) { background-clip: @r; } // background size .background-size(@arguments) when (@arguments = cover), (@arguments = contain) { background-size: @arguments; } .background-size(@arguments) when not (@arguments = cover) and not (@arguments = contain) { .background-size(@arguments, @arguments); } .background-size(@x, @y) { background-size: @x @y; } // background origin .transform-origin(@x, @y) { -webkit-transform-origin: @arguments; -moz-transform-origin: @arguments; -ms-transform-origin: @arguments; -o-transform-origin: @arguments; transform-origin: @arguments; } //transitions .transition(@none) { -webkit-transition: none; -moz-transition: none; -ms-transition: none; -o-transition: none; transition: none; } .transition(@range, @time, @ease) { -webkit-transition: @arguments; -moz-transition: @arguments; -ms-transition: @arguments; -o-transition: @arguments; transition: @arguments; } .transition-timing-function(@function) { -webkit-transition-timing-function: @function; -moz-transition-timing-function: @function; -ms-transition-timing-function: @function; -o-transition-timing-function: @function; transition-timing-function: @function; } // Transformations .skew(@angle_x:35deg, @angle_y:0deg) { -webkit-transform: skew(@angle_x, @angle_y); -moz-transform: skew(@angle_x, @angle_y); -ms-transform: skew(@angle_x, @angle_y); -o-transform: skew(@angle_x, @angle_y); transform: skew(@angle_x, @angle_y); } .scale(@scale_x: 1) { -webkit-transform: scale(@scale_x); -moz-transform: scale(@scale_x); -ms-transform: scale(@scale_x); -o-transform: scale(@scale_x); transform: scale(@scale_x); } .rotate(@angle:35deg) { -webkit-transform: rotate(@angle); -moz-transform: rotate(@angle); -ms-transform: rotate(@angle); -o-transform: rotate(@angle); transform: rotate(@angle); } .translate(@move_x:10px, @move_y:10px) { -webkit-transform: translate(@move_x, @move_y); -moz-transform: translate(@move_x, @move_y); -ms-transform: translate(@move_x, @move_y); -o-transform: translate(@move_x, @move_y); transform: translate(@move_x, @move_y); } // Columns .columns(@column-count) { .columns(@column-count, auto); } .columns(@column-count, @column-width) { -webkit-columns: @arguments; -moz-columns: @arguments; columns: @arguments; } // CSS3 Image Filters // // As found at: https://dvcs.w3.org/hg/FXTF/raw-file/tip/filters/index.html#FilterFunction // // Options available include: // // grayscale( | ) // sepia( | ) // saturate( | ) // hue-rotate() // invert( | ) // opacity( | ) // brightness( | ) // contrast( | ) // blur() // drop-shadow() .filter(@arguments) { -webkit-filter: @arguments; -moz-filter: @arguments; -ms-filter: @arguments; -o-filter: @arguments; }