// // Mixins // -------------------------------------------------- .clearfix() { &:before, &:after { content: " "; // 1 display: table; // 2 } &:after { clear: both; } } .loader() { &:before { height: 40px; width: 40px; display: block; position: absolute; top: 50%; left: 50%; border-radius: 50%; margin-left: -20px; margin-top: -20px; display: block; content: ""; background: url(../img/spin.gif) center center; background: url(../img/spin.svg) center center; background-size: cover; } } .loading() { &:before { left: 10px; right: 10px; top: 0; opacity: .7; bottom: 10px; display: block; position: absolute; display: block; content: ""; background: rgba(255,255,255,.8) url(../img/spin.gif) center center; background: rgba(255,255,255,.8) url(../img/spin.svg) center center; background-size: 20px 20px; background-repeat: no-repeat; } } .icon_font() { font-family: 'FontAwesome'; src: url('fonts/kt-font-awesome.eot?t9jwae'); src: url('fonts/kt-font-awesome.eot?t9jwae#iefix') format('embedded-opentype'), url('fonts/kt-font-awesome.ttf?t9jwae') format('truetype'), url('fonts/kt-font-awesome.woff?t9jwae') format('woff'), url('fonts/kt-font-awesome.svg?t9jwae#kt-font-awesome') format('svg'); font-weight: normal; font-style: normal; } // Animations .animation(@animation) { -webkit-animation: @animation; -o-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; } .animation-fill-mode(@fill-mode) { -webkit-animation-fill-mode: @fill-mode; animation-fill-mode: @fill-mode; } // Backface visibility // Prevent browsers from flickering when using CSS 3D transforms. // Default value is `visible`, but can be changed to `hidden` .backface-visibility(@visibility) { -webkit-backface-visibility: @visibility; -moz-backface-visibility: @visibility; backface-visibility: @visibility; } // Drop shadows // .box-shadow(@shadow) { -webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1 box-shadow: @shadow; } // Box sizing .box-sizing(@boxmodel) { -webkit-box-sizing: @boxmodel; -moz-box-sizing: @boxmodel; box-sizing: @boxmodel; } // CSS3 Content Columns .content-columns(@column-count; @column-gap: @grid-gutter-width) { -webkit-column-count: @column-count; -moz-column-count: @column-count; column-count: @column-count; -webkit-column-gap: @column-gap; -moz-column-gap: @column-gap; column-gap: @column-gap; } // Optional hyphenation .hyphens(@mode: auto) { word-wrap: break-word; -webkit-hyphens: @mode; -moz-hyphens: @mode; -ms-hyphens: @mode; // IE10+ -o-hyphens: @mode; hyphens: @mode; } // Placeholder text .placeholder(@color: @input-color-placeholder) { // Firefox &::-moz-placeholder { color: @color; opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526 } &:-ms-input-placeholder { color: @color; } // Internet Explorer 10+ &::-webkit-input-placeholder { color: @color; } // Safari and Chrome } // Transformations .transform(@transform) { -webkit-transform: @transform; -ms-transform: @transform; // IE9 only -o-transform: @transform; transform: @transform; } .scale(@ratio) { -webkit-transform: scale(@ratio); -ms-transform: scale(@ratio); // IE9 only -o-transform: scale(@ratio); transform: scale(@ratio); } .scale(@ratioX; @ratioY) { -webkit-transform: scale(@ratioX, @ratioY); -ms-transform: scale(@ratioX, @ratioY); // IE9 only -o-transform: scale(@ratioX, @ratioY); transform: scale(@ratioX, @ratioY); } .scaleX(@ratio) { -webkit-transform: scaleX(@ratio); -ms-transform: scaleX(@ratio); // IE9 only -o-transform: scaleX(@ratio); transform: scaleX(@ratio); } .scaleY(@ratio) { -webkit-transform: scaleY(@ratio); -ms-transform: scaleY(@ratio); // IE9 only -o-transform: scaleY(@ratio); transform: scaleY(@ratio); } .skew(@x; @y) { -webkit-transform: skewX(@x) skewY(@y); -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+ -o-transform: skewX(@x) skewY(@y); transform: skewX(@x) skewY(@y); } .translate(@x; @y) { -webkit-transform: translate(@x, @y); -ms-transform: translate(@x, @y); // IE9 only -o-transform: translate(@x, @y); transform: translate(@x, @y); } .translateY(@y) { -webkit-transform: translateY(@y); -ms-transform: translateY(@y); // IE9 only -o-transform: translateY(@y); transform: translateY(@y); } .translateX(@x) { -webkit-transform: translateX(@x); -ms-transform: translateX(@x); // IE9 onlx -o-transform: translateX(@x); transform: translateX(@x); } .translate3d(@x; @y; @z) { -webkit-transform: translate3d(@x, @y, @z); transform: translate3d(@x, @y, @z); } .rotate(@degrees) { -webkit-transform: rotate(@degrees); -ms-transform: rotate(@degrees); // IE9 only -o-transform: rotate(@degrees); transform: rotate(@degrees); } .rotateX(@degrees) { -webkit-transform: rotateX(@degrees); -ms-transform: rotateX(@degrees); // IE9 only -o-transform: rotateX(@degrees); transform: rotateX(@degrees); } .rotateY(@degrees) { -webkit-transform: rotateY(@degrees); -ms-transform: rotateY(@degrees); // IE9 only -o-transform: rotateY(@degrees); 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-style(@transform_style) { -webkit-transform-style: @transform_style; -moz-transform-style: @transform_style; transform-style: @transform_style; } .transform-origin(@origin) { -webkit-transform-origin: @origin; -moz-transform-origin: @origin; -ms-transform-origin: @origin; // IE9 only transform-origin: @origin; } // Transitions .transition(@transition) { -webkit-transition: @transition; -o-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; } // User select // For selecting text on the page .user-select(@select) { -webkit-user-select: @select; -moz-user-select: @select; -ms-user-select: @select; // IE10+ user-select: @select; } // Opacity .opacity(@opacity) { opacity: @opacity; // IE8 filter @opacity-ie: (@opacity * 100); filter: ~"alpha(opacity=@{opacity-ie})"; } // GRADIENTS // -------------------------------------------------- #gradient { // Horizontal gradient, from left to right // // Creates two color stops, start and end, by specifying a color and position for each color stop. // Color stops are not available in IE9 and below. .horizontal(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) { background-image: -webkit-gradient(linear, @start-percent top, @end-percent top, from(@start-color), to(@end-color)); // Safari 4+, Chrome 2+ background-image: -webkit-linear-gradient(left, color-stop(@start-color @start-percent), color-stop(@end-color @end-percent)); // Safari 5.1+, Chrome 10+ background-image: -moz-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // FF 3.6+ background-image: linear-gradient(to right, @start-color @start-percent, @end-color @end-percent); // Standard, IE10 background-repeat: repeat-x; filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@start-color),argb(@end-color))); // IE9 and down } // Vertical gradient, from top to bottom // // Creates two color stops, start and end, by specifying a color and position for each color stop. // Color stops are not available in IE9 and below. .vertical(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) { background-image: -webkit-gradient(linear, left @start-percent, left @end-percent, from(@start-color), to(@end-color)); // Safari 4+, Chrome 2+ background-image: -webkit-linear-gradient(top, @start-color, @start-percent, @end-color, @end-percent); // Safari 5.1+, Chrome 10+ background-image: -moz-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // FF 3.6+ background-image: linear-gradient(to bottom, @start-color @start-percent, @end-color @end-percent); // Standard, IE10 background-repeat: repeat-x; filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@start-color),argb(@end-color))); // IE9 and down } .directional(@start-color: #555; @end-color: #333; @deg: 45deg) { background-repeat: repeat-x; background-image: -webkit-linear-gradient(@deg, @start-color, @end-color); // Safari 5.1+, Chrome 10+ background-image: -moz-linear-gradient(@deg, @start-color, @end-color); // FF 3.6+ background-image: linear-gradient(@deg, @start-color, @end-color); // Standard, IE10 } .horizontal-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) { background-image: -webkit-gradient(left, linear, 0 0, 0 100%, from(@start-color), color-stop(@color-stop, @mid-color), to(@end-color)); background-image: -webkit-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color); background-image: -moz-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color); background-image: linear-gradient(to right, @start-color, @mid-color @color-stop, @end-color); background-repeat: no-repeat; filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback } .vertical-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) { background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@start-color), color-stop(@color-stop, @mid-color), to(@end-color)); background-image: -webkit-linear-gradient(@start-color, @mid-color @color-stop, @end-color); background-image: -moz-linear-gradient(top, @start-color, @mid-color @color-stop, @end-color); background-image: linear-gradient(@start-color, @mid-color @color-stop, @end-color); background-repeat: no-repeat; filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback } .radial(@inner-color: #555; @outer-color: #333) { background-image: -webkit-gradient(radial, center center, 0, center center, 460, from(@inner-color), to(@outer-color)); background-image: -webkit-radial-gradient(circle, @inner-color, @outer-color); background-image: -moz-radial-gradient(circle, @inner-color, @outer-color); background-image: radial-gradient(circle, @inner-color, @outer-color); background-repeat: no-repeat; } .striped(@color: #555; @angle: 45deg) { 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: 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); } } // Reset filters for IE // // When you need to remove a gradient background, do not forget to use this to reset // the IE filter for IE9 and below. .reset-filter() { filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)")); } // Flexbox display // flex or inline-flex .flex-display(@display: flex) { display: ~"-webkit-@{display}"; display: ~"-ms-@{display}box"; // IE10 uses -ms-flexbox display: ~"-ms-@{display}"; // IE11 display: @display; } // The 'flex' shorthand // - applies to: flex items // , initial, auto, or none .flex(@columns: initial) { -webkit-flex: @columns; -ms-flex: @columns; flex: @columns; } // Flex Flow Direction // - applies to: flex containers // row | row-reverse | column | column-reverse .flex-direction(@direction: row) { -webkit-flex-direction: @direction; -ms-flex-direction: @direction; flex-direction: @direction; } // Flex Line Wrapping // - applies to: flex containers // nowrap | wrap | wrap-reverse .flex-wrap(@wrap: nowrap) { -webkit-flex-wrap: @wrap; -ms-flex-wrap: @wrap; flex-wrap: @wrap; } // Flex Direction and Wrap // - applies to: flex containers // || .flex-flow(@flow) { -webkit-flex-flow: @flow; -ms-flex-flow: @flow; flex-flow: @flow; } // Display Order // - applies to: flex items // .flex-order(@order: 0) { -webkit-order: @order; -ms-order: @order; order: @order; } // Flex grow factor // - applies to: flex items // .flex-grow(@grow: 0) { -webkit-flex-grow: @grow; -ms-flex-grow: @grow; flex-grow: @grow; } // Flex shrink // - applies to: flex item shrink factor // .flex-shrink(@shrink: 1) { -webkit-flex-shrink: @shrink; -ms-flex-shrink: @shrink; flex-shrink: @shrink; } // Flex basis // - the initial main size of the flex item // - applies to: flex itemsnitial main size of the flex item // .flex-basis(@width: auto) { -webkit-flex-basis: @width; -ms-flex-basis: @width; flex-basis: @width; } // Axis Alignment // - applies to: flex containers // flex-start | flex-end | center | space-between | space-around .justify-content(@justify: flex-start) { -webkit-justify-content: @justify; -ms-justify-content: @justify; justify-content: @justify; } // Packing Flex Lines // - applies to: multi-line flex containers // flex-start | flex-end | center | space-between | space-around | stretch .align-content(@align: stretch) { -webkit-align-content: @align; -ms-align-content: @align; align-content: @align; } // Cross-axis Alignment // - applies to: flex containers // flex-start | flex-end | center | baseline | stretch .align-items(@align: stretch) { -webkit-align-items: @align; -ms-align-items: @align; align-items: @align; } // Cross-axis Alignment // - applies to: flex items // auto | flex-start | flex-end | center | baseline | stretch .align-self(@align: auto) { -webkit-align-self: @align; -ms-align-self: @align; align-self: @align; }