/* VENDOR MIXINS */
|
|
|
|
|
|
// Rounded corners
|
|
.border-top-radius(@radius) {
|
|
border-top-right-radius: @radius;
|
|
border-top-left-radius: @radius;
|
|
}
|
|
.border-right-radius(@radius) {
|
|
border-bottom-right-radius: @radius;
|
|
border-top-right-radius: @radius;
|
|
}
|
|
.border-bottom-radius(@radius) {
|
|
border-bottom-right-radius: @radius;
|
|
border-bottom-left-radius: @radius;
|
|
}
|
|
.border-left-radius(@radius) {
|
|
border-bottom-left-radius: @radius;
|
|
border-top-left-radius: @radius;
|
|
}
|
|
|
|
|
|
// Box shadows
|
|
.box-shadow(@shadow: 0 1px 3px rgba(0,0,0,.25)) {
|
|
-webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1
|
|
box-shadow: @shadow;
|
|
}
|
|
|
|
|
|
// Transitions
|
|
.transition(@transition) {
|
|
-webkit-transition: @transition;
|
|
transition: @transition;
|
|
}
|
|
.transition-property(@transition-property) {
|
|
-webkit-transition-property: @transition-property;
|
|
transition-property: @transition-property;
|
|
}
|
|
.transition-delay(@transition-delay) {
|
|
-webkit-transition-delay: @transition-delay;
|
|
transition-delay: @transition-delay;
|
|
}
|
|
.transition-duration(@transition-duration) {
|
|
-webkit-transition-duration: @transition-duration;
|
|
transition-duration: @transition-duration;
|
|
}
|
|
.transition-timing-function(@timing-function) {
|
|
-webkit-transition-timing-function: @timing-function;
|
|
transition-timing-function: @timing-function;
|
|
}
|
|
.transition-transform(@transition) {
|
|
-webkit-transition: -webkit-transform @transition;
|
|
-moz-transition: -moz-transform @transition;
|
|
-o-transition: -o-transform @transition;
|
|
transition: transform @transition;
|
|
}
|
|
|
|
|
|
// Transformations
|
|
.rotate(@degrees) {
|
|
-webkit-transform: rotate(@degrees);
|
|
-ms-transform: rotate(@degrees); // IE9 only
|
|
transform: rotate(@degrees);
|
|
}
|
|
.scale(@ratio; @ratio-y...) {
|
|
-webkit-transform: scale(@ratio, @ratio-y);
|
|
-ms-transform: scale(@ratio, @ratio-y); // IE9 only
|
|
transform: scale(@ratio, @ratio-y);
|
|
}
|
|
.translate(@x; @y) {
|
|
-webkit-transform: translate(@x, @y);
|
|
-ms-transform: translate(@x, @y); // IE9 only
|
|
transform: translate(@x, @y);
|
|
}
|
|
.skew(@x; @y) {
|
|
-webkit-transform: skew(@x, @y);
|
|
-ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
|
|
transform: skew(@x, @y);
|
|
}
|
|
.translate3d(@x; @y; @z) {
|
|
-webkit-transform: translate3d(@x, @y, @z);
|
|
transform: translate3d(@x, @y, @z);
|
|
}
|
|
|
|
.rotateX(@degrees) {
|
|
-webkit-transform: rotateX(@degrees);
|
|
-ms-transform: rotateX(@degrees); // IE9 only
|
|
transform: rotateX(@degrees);
|
|
}
|
|
.rotateY(@degrees) {
|
|
-webkit-transform: rotateY(@degrees);
|
|
-ms-transform: rotateY(@degrees); // IE9 only
|
|
transform: rotateY(@degrees);
|
|
}
|
|
.perspective(@perspective) {
|
|
-webkit-perspective: @perspective;
|
|
-moz-perspective: @perspective;
|
|
perspective: @perspective;
|
|
}
|
|
.perspective-origin(@perspective) {
|
|
-webkit-perspective-origin: @perspective;
|
|
-moz-perspective-origin: @perspective;
|
|
perspective-origin: @perspective;
|
|
}
|
|
.transform-origin(@origin) {
|
|
-webkit-transform-origin: @origin;
|
|
-moz-transform-origin: @origin;
|
|
-ms-transform-origin: @origin; // IE9 only
|
|
transform-origin: @origin;
|
|
}
|
|
|
|
|
|
// Animations
|
|
.animation(@animation) {
|
|
-webkit-animation: @animation;
|
|
animation: @animation;
|
|
}
|
|
.animation-name(@name) {
|
|
-webkit-animation-name: @name;
|
|
animation-name: @name;
|
|
}
|
|
.animation-duration(@duration) {
|
|
-webkit-animation-duration: @duration;
|
|
animation-duration: @duration;
|
|
}
|
|
.animation-timing-function(@timing-function) {
|
|
-webkit-animation-timing-function: @timing-function;
|
|
animation-timing-function: @timing-function;
|
|
}
|
|
.animation-delay(@delay) {
|
|
-webkit-animation-delay: @delay;
|
|
animation-delay: @delay;
|
|
}
|
|
.animation-iteration-count(@iteration-count) {
|
|
-webkit-animation-iteration-count: @iteration-count;
|
|
animation-iteration-count: @iteration-count;
|
|
}
|
|
.animation-direction(@direction) {
|
|
-webkit-animation-direction: @direction;
|
|
animation-direction: @direction;
|
|
}
|
|
|
|
|
|
// Opacity
|
|
.opacity(@opacity) {
|
|
opacity: @opacity;
|
|
// IE8 filter
|
|
@opacity-ie: (@opacity * 100);
|
|
filter: ~"alpha(opacity=@{opacity-ie})";
|
|
}
|
|
|
|
|
|
// Placeholder text
|
|
.placeholder(@color: @input-color-placeholder) {
|
|
&::-moz-placeholder { color: @color; } // Firefox
|
|
&:-ms-input-placeholder { color: @color; } // Internet Explorer 10+
|
|
&::-webkit-input-placeholder { color: @color; } // Safari and Chrome
|
|
}
|
|
|
|
|
|
// Colums
|
|
.content-columns(@width; @count; @gap) {
|
|
-webkit-column-width: @width;
|
|
-moz-column-width: @width;
|
|
column-width: @width;
|
|
-webkit-column-count: @count;
|
|
-moz-column-count: @count;
|
|
column-count: @count;
|
|
-webkit-column-gap: @gap;
|
|
-moz-column-gap: @gap;
|
|
column-gap: @gap;
|
|
}
|
|
|
|
|
|
// Gradients
|
|
#gradient > .vertical(#333; #000);
|
|
#gradient > .horizontal(#333; #000);
|
|
#gradient > .radial(#333; #000);
|
|
#gradient > .directional(#333; #000; 45deg);
|
|
#gradient > .striped(#333; 45deg);
|
|
#gradient > .vertical-three-colors(#777; #333; 25%; #000);
|
|
#gradient > .horizontal-three-colors(#777; #333; 25%; #000);
|
|
|
|
|
|
|
|
|
|
/* UTILITY MIXINS */
|
|
|
|
|
|
// Clearfix
|
|
.clearfix() {
|
|
&:before,
|
|
&:after {
|
|
content: " ";
|
|
display: table;
|
|
}
|
|
&:after {
|
|
clear: both;
|
|
}
|
|
}
|
|
|
|
|
|
// Horizontal centering
|
|
.center-block() {
|
|
display: block;
|
|
margin-left: auto;
|
|
margin-right: auto;
|
|
}
|
|
|
|
|
|
// Sizing Helpers
|
|
.size(@width; @height) {
|
|
width: @width;
|
|
height: @height;
|
|
}
|
|
.square(@size) {
|
|
.size(@size; @size);
|
|
}
|
|
|
|
|
|
// Resizable Textarea
|
|
.resizable(@direction: both) {
|
|
// Options: horizontal, vertical, both
|
|
resize: @direction;
|
|
// Safari fix
|
|
overflow: auto;
|
|
}
|
|
|
|
|
|
// Truncating text
|
|
.text-overflow() {
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
|
|
// Retina Images
|
|
.img-retina(@file-1x; @file-2x; @width-1x; @height-1x) {
|
|
background-image: url("@{file-1x}");
|
|
|
|
@media
|
|
only screen and (-webkit-min-device-pixel-ratio: 2),
|
|
only screen and ( min--moz-device-pixel-ratio: 2),
|
|
only screen and ( -o-min-device-pixel-ratio: 2/1),
|
|
only screen and ( min-device-pixel-ratio: 2),
|
|
only screen and ( min-resolution: 192dpi),
|
|
only screen and ( min-resolution: 2dppx) {
|
|
background-image: url("@{file-2x}");
|
|
background-size: @width-1x @height-1x;
|
|
}
|
|
}
|
|
|