2016-09-08 17:19:15 +00:00
|
|
|
/**
|
|
|
|
* Animation mixin.
|
|
|
|
*/
|
|
|
|
@mixin animation($animate...) {
|
2017-02-22 23:14:09 +00:00
|
|
|
$max: length($animate);
|
|
|
|
$animations: '';
|
2016-09-08 17:19:15 +00:00
|
|
|
|
2017-02-22 23:14:09 +00:00
|
|
|
@for $i from 1 through $max {
|
|
|
|
$animations: #{$animations + nth($animate, $i)};
|
2016-09-08 17:19:15 +00:00
|
|
|
|
2017-02-22 23:14:09 +00:00
|
|
|
@if $i < $max {
|
|
|
|
$animations: #{$animations + ", "};
|
|
|
|
}
|
2016-09-08 17:19:15 +00:00
|
|
|
}
|
2017-02-22 23:14:09 +00:00
|
|
|
-webkit-animation: $animations;
|
|
|
|
-moz-animation: $animations;
|
|
|
|
-o-animation: $animations;
|
|
|
|
animation: $animations;
|
2016-09-08 17:19:15 +00:00
|
|
|
}
|
|
|
|
|
2016-10-12 00:08:24 +00:00
|
|
|
@mixin flex() {
|
2017-02-22 23:14:09 +00:00
|
|
|
display: -webkit-box;
|
|
|
|
display: -moz-box;
|
|
|
|
display: -ms-flexbox;
|
|
|
|
display: -webkit-flex;
|
|
|
|
display: flex;
|
2016-10-12 00:08:24 +00:00
|
|
|
}
|
|
|
|
|
2016-09-08 17:19:15 +00:00
|
|
|
/**
|
|
|
|
* Keyframes mixin.
|
|
|
|
*/
|
|
|
|
@mixin keyframes($animationName) {
|
2017-02-22 23:14:09 +00:00
|
|
|
@-webkit-keyframes #{$animationName} {
|
|
|
|
@content;
|
|
|
|
}
|
|
|
|
@-moz-keyframes #{$animationName} {
|
|
|
|
@content;
|
|
|
|
}
|
|
|
|
@-o-keyframes #{$animationName} {
|
|
|
|
@content;
|
|
|
|
}
|
|
|
|
@keyframes #{$animationName} {
|
|
|
|
@content;
|
|
|
|
}
|
2016-09-13 16:15:07 +00:00
|
|
|
}
|
|
|
|
|
2016-09-15 02:20:54 +00:00
|
|
|
@mixin circle($diameter) {
|
2017-02-22 23:14:09 +00:00
|
|
|
width: $diameter;
|
|
|
|
height: $diameter;
|
|
|
|
border-radius: 50%;
|
2016-09-15 02:20:54 +00:00
|
|
|
}
|
|
|
|
|
2016-10-26 14:50:39 +00:00
|
|
|
/**
|
|
|
|
* Absolute position the element at the top left corner
|
|
|
|
**/
|
|
|
|
@mixin topLeft() {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
}
|
|
|
|
|
2016-10-27 13:09:27 +00:00
|
|
|
@mixin absoluteAligning() {
|
2017-02-22 23:14:09 +00:00
|
|
|
top: 50%;
|
|
|
|
left: 50%;
|
|
|
|
position: absolute;
|
|
|
|
@include transform(translate(-50%, -50%));
|
2016-09-15 02:20:54 +00:00
|
|
|
}
|
|
|
|
|
2016-11-08 11:36:43 +00:00
|
|
|
/**
|
|
|
|
* Defines the maximum width and height
|
|
|
|
**/
|
|
|
|
@mixin maxSize($value) {
|
|
|
|
max-width: $value;
|
|
|
|
max-height: $value;
|
|
|
|
}
|
|
|
|
|
2016-09-13 16:15:07 +00:00
|
|
|
@mixin transform($func) {
|
2017-02-22 23:14:09 +00:00
|
|
|
-moz-transform: $func;
|
|
|
|
-ms-transform: $func;
|
|
|
|
-webkit-transform: $func;
|
|
|
|
-o-transform: $func;
|
|
|
|
transform: $func;
|
2016-09-13 16:15:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@mixin transition($transition...) {
|
2017-02-22 23:14:09 +00:00
|
|
|
-moz-transition: $transition;
|
|
|
|
-o-transition: $transition;
|
|
|
|
-webkit-transition: $transition;
|
|
|
|
transition: $transition;
|
2016-10-18 13:53:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2017-02-22 22:40:51 +00:00
|
|
|
* Mixin styling a placeholder.
|
|
|
|
**/
|
2016-10-18 13:53:28 +00:00
|
|
|
@mixin placeholder() {
|
2017-02-22 23:14:09 +00:00
|
|
|
$selectors: (
|
|
|
|
"::-webkit-input-placeholder",
|
|
|
|
"::-moz-placeholder",
|
|
|
|
":-moz-placeholder",
|
|
|
|
":-ms-input-placeholder"
|
|
|
|
);
|
|
|
|
|
|
|
|
@each $selector in $selectors {
|
|
|
|
#{$selector} {
|
|
|
|
@content;
|
|
|
|
}
|
2016-10-18 13:53:28 +00:00
|
|
|
}
|
2016-10-13 18:19:42 +00:00
|
|
|
}
|
|
|
|
|
2017-02-22 22:40:51 +00:00
|
|
|
/**
|
|
|
|
* Mixin styling a slider track for different browsers.
|
|
|
|
**/
|
|
|
|
@mixin slider() {
|
2017-02-22 23:14:09 +00:00
|
|
|
$selectors: (
|
|
|
|
"input[type=range]::-webkit-slider-runnable-track",
|
|
|
|
"input[type=range]::-moz-range-track",
|
|
|
|
"input[type=range]::-ms-track"
|
|
|
|
);
|
|
|
|
|
|
|
|
@each $selector in $selectors {
|
|
|
|
#{$selector} {
|
|
|
|
@content;
|
|
|
|
}
|
2017-02-22 22:40:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Mixin styling a slider thumb for different browsers.
|
|
|
|
**/
|
|
|
|
@mixin slider-thumb() {
|
2017-02-22 23:14:09 +00:00
|
|
|
$selectors: (
|
|
|
|
"input[type=range]::-webkit-slider-thumb",
|
|
|
|
"input[type=range]::-moz-range-thumb",
|
|
|
|
"input[type=range]::-ms-thumb"
|
|
|
|
);
|
|
|
|
|
|
|
|
@each $selector in $selectors {
|
|
|
|
#{$selector} {
|
|
|
|
@content;
|
|
|
|
}
|
2017-02-22 22:40:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-10-13 18:19:42 +00:00
|
|
|
@mixin box-shadow($h, $y, $blur, $color, $inset: false) {
|
2017-02-22 23:14:09 +00:00
|
|
|
@if $inset {
|
|
|
|
-webkit-box-shadow: inset $h $y $blur $color;
|
|
|
|
-moz-box-shadow: inset $h $y $blur $color;
|
|
|
|
box-shadow: inset $h $y $blur $color;
|
|
|
|
} @else {
|
|
|
|
-webkit-box-shadow: $h $y $blur $color;
|
|
|
|
-moz-box-shadow: $h $y $blur $color;
|
|
|
|
box-shadow: $h $y $blur $color;
|
|
|
|
}
|
2016-10-13 18:19:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@mixin no-box-shadow {
|
2017-02-22 23:14:09 +00:00
|
|
|
-webkit-box-shadow: none;
|
|
|
|
-moz-box-shadow: none;
|
|
|
|
box-shadow: none;
|
2016-10-13 18:19:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@mixin box-sizing($box-model) {
|
2017-02-22 23:14:09 +00:00
|
|
|
-webkit-box-sizing: $box-model; // Safari <= 5
|
|
|
|
-moz-box-sizing: $box-model; // Firefox <= 19
|
|
|
|
box-sizing: $box-model;
|
2016-10-13 18:19:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@mixin border-radius($radius) {
|
2017-02-22 23:14:09 +00:00
|
|
|
-webkit-border-radius: $radius;
|
|
|
|
border-radius: $radius;
|
|
|
|
/* stops bg color from leaking outside the border: */
|
|
|
|
background-clip: padding-box;
|
2016-10-13 18:19:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@mixin opacity($opacity) {
|
2017-02-22 23:14:09 +00:00
|
|
|
opacity: $opacity;
|
|
|
|
$opacity-ie: $opacity * 100;
|
|
|
|
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=$opacity-ie);
|
|
|
|
filter: alpha(opacity=$opacity-ie); //IE8
|
2016-10-13 18:19:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@mixin text-truncate {
|
2017-02-22 23:14:09 +00:00
|
|
|
display: block;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
white-space: nowrap;
|
2016-12-06 05:38:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a semi-transparent background with the given color and alpha
|
|
|
|
* (opacity) value.
|
|
|
|
*/
|
|
|
|
@mixin transparentBg($color, $alpha) {
|
2017-02-22 23:14:09 +00:00
|
|
|
background-color: rgba(red($color), green($color), blue($color), $alpha);
|
2016-10-12 00:08:24 +00:00
|
|
|
}
|