4 $box-sizing-prefix: webkit moz spec;
5 $border-radius-prefix: webkit spec;
6 $box-shadow-radius-prefix: webkit moz spec;
7 $text-shadow-radius-prefix: spec;
8 $text-shadow-prefix: spec;
9 $box-shadow-prefix: all;
10 $linear-gradient-prefix: all;
11 $transition-prefix: webkit moz o spec;
12 $flex-prefix: webkit spec;
13 $browserPrefixes: webkit moz o ms;
15 @mixin prefix($property, $value, $prefixeslist: 'all') {
16 @if $prefixeslist == all {
17 -webkit-#{$property}: $value;
18 -moz-#{$property}: $value;
19 -ms-#{$property}: $value;
20 -o-#{$property}: $value;
23 @each $prefix in $prefixeslist {
24 @if $prefix == webkit {
25 -webkit-#{$property}: $value;
26 } @else if $prefix == moz {
27 -moz-#{$property}: $value;
28 } @else if $prefix == ms {
29 -ms-#{$property}: $value;
30 } @else if $prefix == o {
31 -o-#{$property}: $value;
32 } @else if $prefix == spec {
35 @warn "No such prefix: #{$prefix}";
42 @mixin value-suffix-with-range($property, $valuesuffix, $from, $to, $prefixeslist) {
44 @if $prefixeslist == all {
45 #{property} : -webkit-#{$valuesuffix}($from, $to);
46 #{property} : -moz-#{$valuesuffix}($from, $to);
47 #{property} : -o-#{$valuesuffix}($from, $to);
48 #{property} : -ms-#{$valuesuffix}($from, $to);
51 @each $prefix in $prefixeslist {
52 @if $prefix == webkit {
53 #{property} : -webkit-#{$valuesuffix}($from, $to);
54 } @else if $prefix == moz {
55 #{property} : -moz-#{$valuesuffix}($from, $to);
56 } @else if $prefix == ms {
57 #{property} : -ms-#{$valuesuffix}($from, $to);
58 } @else if $prefix == o {
59 #{property} : -o-#{$valuesuffix}($from, $to);
61 @warn "No such prefix: #{$prefix}";
68 @mixin box-sizing($value: border-box) {
69 @include prefix(box-sizing, $value, $box-sizing-prefix);
72 /* Borders & Shadows */
73 @mixin box-shadow($value) {
74 @include prefix(box-shadow, $value, $box-shadow-radius-prefix);
77 @mixin sticky($value) {
82 @mixin text-shadow($value) {
83 @include prefix(text-shadow, $value, $text-shadow-radius-prefix);
86 @mixin border-radius($value, $positions: all) {
87 @if ($positions == all) {
88 @include prefix(border-radius, $value, $border-radius-prefix);
90 @each $position in $positions {
91 @include prefix(border-#{$position}-radius, $value, $border-radius-prefix);
97 @mixin transition($value) {
98 @include prefix(transition, $value, $transition-prefix);
102 @mixin opacity($alpha) {
103 $ie-opacity: round($alpha * 100);
105 filter: unquote("alpha(opacity = #{$ie-opacity})");
109 @mixin ellipsis($width: 100%, $display: inline-block, $max-width: none) {
111 text-overflow: ellipsis;
115 max-width: $max-width;
118 @mixin multiline-ellipsis($lineHeight: 1.3em, $lineCount: 2, $bgColor: $white){
121 line-height: $lineHeight;
122 max-height: $lineHeight * $lineCount;
124 word-break: break-all;
125 // margin-right: -1em;
140 background: $bgColor;
144 @mixin gradient($from, $to) {
145 /* fallback/image non-cover color */
146 background-color: $from;
147 background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from($from), to($to));
148 @include value-suffix-with-range(background-color, linear-gradient, $from, $to, $linear-gradient-prefix);
151 /* Vertical placement of multuple lines of text */
152 @mixin vertical-text($height) {
155 margin-top: -$height/2;
158 @mixin text-vertical-align($align: middle) {
163 vertical-align: $align;
168 @mixin center-element($width) {
174 @mixin center-content($width) {
176 @include center-element($width);
180 /* transform-rotate */
182 // Defines a 2D rotation, the angle is specified in the parameter
184 // $deg - angle in degrees
185 @mixin transform-rotate($deg) {
186 transform: rotate($deg + deg); /* IE10 and Mozilla */
187 -ms-transform: rotate($deg + deg); /* IE 9 */
188 -webkit-transform: rotate($deg + deg); /* Safari and Chrome */
191 /* transform-translate */
193 // Defines a 2D rotation, the angle is specified in the parameter
195 // $deg - angle in degrees
196 @mixin transform-translate($x, $y) {
197 transform: translate($x, $y); /* IE10 and Mozilla */
198 -ms-transform: translate($x, $y); /* IE 9 */
199 -webkit-transform: translate($x, $y); /* Safari and Chrome */
202 /* transform-scale */
204 // Defines a 2D scale transformation, changing the elements width and height
209 @mixin transform-scale($width, $height) {
210 transform: scale($width, $height); /* IE10 and Mozilla */
211 -ms-transform: scale($width, $height); /* IE 9 */
212 -webkit-transform: scale($width, $height); /* Safari and Chrome */
215 @mixin scrollable() {
216 ::-webkit-scrollbar {
221 @mixin create-circle($size, $bgcolor) {
225 background: $bgcolor;
226 border: 3px solid $bgcolor;
229 justify-content: center;
233 @mixin keyframe-animation($animationType, $properties, $fromValue, $toValue) {
235 @keyframes #{$animationType} {
238 @each $property in $properties {
239 #{$property}: nth($fromValue, $startIndex);
240 $startIndex: $startIndex + 1;
245 @each $property in $properties {
246 #{$property}: nth($toValue, $startIndex);
247 $startIndex: $startIndex + 1;
251 @-moz-keyframes #{$animationType}{
255 @each $property in $properties {
256 #{$property}: nth($fromValue, $startIndex);
257 $startIndex: $startIndex + 1;
262 @each $property in $properties {
263 #{$property}: nth($toValue, $startIndex);
264 $startIndex: $startIndex + 1;
268 @-webkit-keyframes #{$animationType} {
269 /* Safari and Chrome */
272 @each $property in $properties {
273 #{$property}: nth($fromValue, $startIndex);
274 $startIndex: $startIndex + 1;
279 @each $property in $properties {
280 #{$property}: nth($toValue, $startIndex);
281 $startIndex: $startIndex + 1;
285 @-o-keyframes #{$animationType} {
289 @each $property in $properties {
290 #{$property}: nth($fromValue, $startIndex);
291 $startIndex: $startIndex + 1;
296 @each $property in $properties {
297 #{$property}: nth($toValue, $startIndex);
298 $startIndex: $startIndex + 1;
306 @mixin border-shadow($xShadow: 0.545px, $yShadow: 0.839px, $blur: 4px, $spread: 0, $color: $light-gray, $opacity: 0.2) {
307 @include box-shadow($xShadow $yShadow $blur $spread rgba($color, $opacity));
310 /* percent-plus-value */
312 // Calculate length property (e.g. width, margin) by adding a value (e.g. in pixels)
313 // to a percentage of container height/width
314 @mixin percent-plus-value($property, $value, $percent: 100%) {
315 $string: 'calc(' + $percent + ' + ' + $value + ')';
316 #{$property}: unquote($string);