-
Notifications
You must be signed in to change notification settings - Fork 12
/
_mixins.scss
133 lines (105 loc) · 3.38 KB
/
_mixins.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
@mixin triangle ($size, $color, $direction) {
height: 0;
width: 0;
$width: nth($size, 1);
$height: nth($size, length($size));
$foreground-color: nth($color, 1);
$background-color: transparent !default;
@if length($color)==2 {
$background-color: nth($color, 2);
}
@if $direction==up or $direction==down or $direction==right or $direction==left {
$width: $width / 2;
@if $direction==up {
border-left: $width solid $background-color;
border-right: $width solid $background-color;
border-bottom: $height solid $foreground-color;
}
@else if $direction==right {
border-top: $width solid $background-color;
border-bottom: $width solid $background-color;
border-left: $height solid $foreground-color;
}
@else if $direction==down {
border-left: $width solid $background-color;
border-right: $width solid $background-color;
border-top: $height solid $foreground-color;
}
@else if $direction==left {
border-top: $width solid $background-color;
border-bottom: $width solid $background-color;
border-right: $height solid $foreground-color;
}
}
@else if $direction==up-right or $direction==up-left {
border-top: $height solid $foreground-color;
@if $direction==up-right {
border-left: $width solid $background-color;
}
@else if $direction==up-left {
border-right: $width solid $background-color;
}
}
@else if $direction==down-right or $direction==down-left {
border-bottom: $height solid $foreground-color;
@if $direction==down-right {
border-left: $width solid $background-color;
}
@else if $direction==down-left {
border-right: $width solid $background-color;
}
}
@else if $direction==inset-up {
border-width: $height $width;
border-style: solid;
border-color: $background-color $background-color $foreground-color;
}
@else if $direction==inset-down {
border-width: $height $width;
border-style: solid;
border-color: $foreground-color $background-color $background-color;
}
@else if $direction==inset-right {
border-width: $width $height;
border-style: solid;
border-color: $background-color $background-color $background-color $foreground-color;
}
@else if $direction==inset-left {
border-width: $width $height;
border-style: solid;
border-color: $background-color $foreground-color $background-color $background-color;
}
}
@mixin loading-variant ($size, $color, $speed, $border) {
display: block;
position: relative;
height: $size;
width: $size;
color: $color;
&:before {
border-radius: 50%;
border: $border solid currentColor;
opacity: .15;
}
&:after {
-webkit-animation: loader $speed linear;
animation: loader $speed linear;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
border-radius: 50%;
border: $border solid;
border-color: transparent;
border-top-color: currentColor;
box-shadow: 0 0 0 1px transparent;
}
&:before,
&:after {
width: $size;
height: $size;
margin: -($size/2) 0 0 -($size/2);
position: absolute;
content: '';
top: 50%;
left: 50%;
}
}