5 $box-sizing-prefix: webkit moz spec;
6 $border-radius-prefix: webkit spec;
7 $box-shadow-radius-prefix: webkit moz spec;
8 $text-shadow-radius-prefix: spec;
9 $text-shadow-prefix: spec;
10 $box-shadow-prefix: all;
11 $linear-gradient-prefix: all;
12 $transition-prefix: webkit moz o spec;
13 $flex-prefix: webkit spec;
14 $browserPrefixes: webkit moz o ms;
16 @mixin prefix($property, $value, $prefixeslist: 'all') {
17 @if $prefixeslist == all {
18 -webkit-#{$property}: $value;
19 -moz-#{$property}: $value;
20 -ms-#{$property}: $value;
21 -o-#{$property}: $value;
24 @each $prefix in $prefixeslist {
25 @if $prefix == webkit {
26 -webkit-#{$property}: $value;
27 } @else if $prefix == moz {
28 -moz-#{$property}: $value;
29 } @else if $prefix == ms {
30 -ms-#{$property}: $value;
31 } @else if $prefix == o {
32 -o-#{$property}: $value;
33 } @else if $prefix == spec {
36 @warn "No such prefix: #{$prefix}";
43 @mixin value-suffix-with-range($property, $valuesuffix, $from, $to, $prefixeslist) {
45 @if $prefixeslist == all {
46 #{property} : -webkit-#{$valuesuffix}($from, $to);
47 #{property} : -moz-#{$valuesuffix}($from, $to);
48 #{property} : -o-#{$valuesuffix}($from, $to);
49 #{property} : -ms-#{$valuesuffix}($from, $to);
52 @each $prefix in $prefixeslist {
53 @if $prefix == webkit {
54 #{property} : -webkit-#{$valuesuffix}($from, $to);
55 } @else if $prefix == moz {
56 #{property} : -moz-#{$valuesuffix}($from, $to);
57 } @else if $prefix == ms {
58 #{property} : -ms-#{$valuesuffix}($from, $to);
59 } @else if $prefix == o {
60 #{property} : -o-#{$valuesuffix}($from, $to);
62 @warn "No such prefix: #{$prefix}";
69 @mixin box-sizing($value: border-box) {
70 @include prefix(box-sizing, $value, $box-sizing-prefix);
73 /* Borders & Shadows */
74 @mixin box-shadow($value) {
75 @include prefix(box-shadow, $value, $box-shadow-radius-prefix);
78 @mixin text-shadow($value) {
79 @include prefix(text-shadow, $value, $text-shadow-radius-prefix);
82 @mixin border-radius($value, $positions: all) {
83 @if ($positions == all) {
84 @include prefix(border-radius, $value, $border-radius-prefix);
86 @each $position in $positions {
87 @include prefix(border-#{$position}-radius, $value, $border-radius-prefix);
93 @mixin transition($value) {
94 @include prefix(transition, $value, $transition-prefix);
98 @mixin opacity($alpha) {
99 $ie-opacity: round($alpha * 100);
101 filter: unquote("alpha(opacity = #{$ie-opacity})");
107 text-overflow: ellipsis;
110 display: inline-block;
113 @mixin gradient($from, $to) {
114 /* fallback/image non-cover color */
115 background-color: $from;
116 background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from($from), to($to));
117 @include value-suffix-with-range(background-color, linear-gradient, $from, $to, $linear-gradient-prefix);
120 /* Vertical placement of multuple lines of text */
121 @mixin vertical-text($height) {
124 margin-top: -$height/2;
127 @mixin multiline-ellipsis($height, $lineheight, $ellipsiswidth: 3em) {
129 $ellipsiswidth: 3em !default;
134 line-height: $lineheight;
144 .ellipsis > *:first-child {
157 width: $ellipsiswidth;
158 margin-left: -$ellipsiswidth;
166 @mixin text-vertical-align($align: middle) {
171 vertical-align: $align;
176 @mixin center-element($width) {
182 @mixin center-content($width) {
184 @include center-element($width);
188 /* transform-rotate */
190 // Defines a 2D rotation, the angle is specified in the parameter
192 // $deg - angle in degrees
193 @mixin transform-rotate($deg) {
194 transform: rotate($deg + deg); /* IE10 and Mozilla */
195 -ms-transform: rotate($deg + deg); /* IE 9 */
196 -webkit-transform: rotate($deg + deg); /* Safari and Chrome */
199 /* transform-translate */
201 // Defines a 2D rotation, the angle is specified in the parameter
203 // $deg - angle in degrees
204 @mixin transform-translate($x, $y) {
205 transform: translate($x, $y); /* IE10 and Mozilla */
206 -ms-transform: translate($x, $y); /* IE 9 */
207 -webkit-transform: translate($x, $y); /* Safari and Chrome */
210 /* transform-scale */
212 // Defines a 2D scale transformation, changing the elements width and height
217 @mixin transform-scale($width, $height) {
218 transform: scale($width, $height); /* IE10 and Mozilla */
219 -ms-transform: scale($width, $height); /* IE 9 */
220 -webkit-transform: scale($width, $height); /* Safari and Chrome */
223 @mixin scrollable() {
224 ::-webkit-scrollbar {
230 @mixin keyframe-animation($animationType, $properties, $fromValue, $toValue) {
232 @keyframes #{$animationType} {
235 @each $property in $properties {
236 #{$property}: nth($fromValue, $startIndex);
237 $startIndex: $startIndex + 1;
242 @each $property in $properties {
243 #{$property}: nth($toValue, $startIndex);
244 $startIndex: $startIndex + 1;
248 @-moz-keyframes #{$animationType}{
252 @each $property in $properties {
253 #{$property}: nth($fromValue, $startIndex);
254 $startIndex: $startIndex + 1;
259 @each $property in $properties {
260 #{$property}: nth($toValue, $startIndex);
261 $startIndex: $startIndex + 1;
265 @-webkit-keyframes #{$animationType} {
266 /* Safari and Chrome */
269 @each $property in $properties {
270 #{$property}: nth($fromValue, $startIndex);
271 $startIndex: $startIndex + 1;
276 @each $property in $properties {
277 #{$property}: nth($toValue, $startIndex);
278 $startIndex: $startIndex + 1;
282 @-o-keyframes #{$animationType} {
286 @each $property in $properties {
287 #{$property}: nth($fromValue, $startIndex);
288 $startIndex: $startIndex + 1;
293 @each $property in $properties {
294 #{$property}: nth($toValue, $startIndex);
295 $startIndex: $startIndex + 1;