_drawing-3.20.scss
ASCII text
1
// generic drawing of more complex things
2
3
4
// ripple effect animations
5
6
@keyframes ripple_effect {
7
to { background-size: 1000% 1000%; }
8
}
9
10
@keyframes scale_ripple_effect {
11
to { background-size: auto, 1000% 1000%; }
12
}
13
14
@keyframes header_ripple_effect {
15
from {
16
background-image: radial-gradient(circle farthest-corner at center,
17
$primary_color 0%,
18
transparent 0%);
19
}
20
21
to {
22
background-image: radial-gradient(circle farthest-corner at center,
23
$primary_color 100%,
24
transparent 0%);
25
}
26
}
27
28
29
@mixin entry($t, $fc: $primary_color) {
30
//
31
// entry
32
//
33
// $t: entry type
34
// $fc: focus color
35
//
36
37
@if $t == raised-normal {
38
transition: $shorter_transition;
39
border-image: none;
40
box-shadow: $shadow_1;
41
background-color: if($fc == $primary_color, $base_color, $fc);
42
color: if($fc == $primary_color, $fg_color, $inverse_fg_color);
43
}
44
45
@if $t == raised-focus {
46
border-image: none;
47
box-shadow: $shadow_2;
48
}
49
50
@if $t == raised-disabled {
51
box-shadow: $shadow_1;
52
background-color: $alt_base_color;
53
color: $disabled_fg_color;
54
}
55
56
@if $t == normal {
57
transition: $shorter_transition, border-image $longer_duration $deceleration_curve;
58
border-image: radial-gradient(circle closest-corner at center calc(100% - 1px),
59
$fc 0%,
60
transparent 0%)
61
0 0 0 / 0 0 0px;
62
box-shadow: inset 0 -1px if($fc == $primary_color, $track_color, $fc);
63
background-color: $fill_color;
64
color: $fg_color;
65
}
66
67
@if $t == focus {
68
border-image: radial-gradient(circle closest-corner at center calc(100% - 1px),
69
$fc 100%,
70
transparent 0%)
71
0 0 2 / 0 0 2px;
72
box-shadow: inset 0 -1px if($fc == $primary_color, $track_color, $fc);
73
}
74
75
@if $t == disabled {
76
box-shadow: inset 0 -1px $divider_color;
77
background-color: $fill_color;
78
color: $disabled_fg_color;
79
}
80
}
81
82
83
@mixin button($t) {
84
//
85
// button
86
//
87
// $t: button type
88
//
89
90
@if $t == normal {
91
transition: $shorter_transition,
92
background-size $ripple_duration $deceleration_curve,
93
background-image $ripple_opacity_duration $deceleration_curve;
94
box-shadow: $shadow_1, inset 0 0 0 9999px transparent;
95
background-color: $surface_color;
96
background-image: radial-gradient(circle farthest-corner at center,
97
transparent 10%,
98
transparent 0%);
99
background-repeat: no-repeat;
100
background-position: center;
101
background-size: 1000% 1000%;
102
color: $fg_color;
103
}
104
105
@if $t == hover {
106
box-shadow: $shadow_2, inset 0 0 0 9999px transparent;
107
color: $fg_color;
108
}
109
110
@if $t == active {
111
transition: $shorter_transition,
112
background-size 0,
113
background-image 0;
114
animation: ripple_effect $longer_duration $deceleration_curve forwards;
115
box-shadow: $shadow_2, inset 0 0 0 9999px $hover_overlay_color;
116
background-image: radial-gradient(circle farthest-corner at center,
117
$active_overlay_color 10%,
118
transparent 0%);
119
background-size: 0% 0%;
120
color: $fg_color;
121
}
122
123
@if $t == disabled {
124
box-shadow: none;
125
background-color: $fill_color;
126
color: $disabled_fg_color;
127
}
128
129
@if $t == checked {
130
background-color: $primary_color;
131
color: $inverse_fg_color;
132
}
133
134
@if $t == checked-disabled {
135
background-color: $divider_color;
136
color: $disabled_fg_color;
137
}
138
139
@if $t == flat-normal {
140
transition: $shorter_transition,
141
border-image $longer_duration $deceleration_curve,
142
background-size $ripple_duration $deceleration_curve,
143
background-image $ripple_opacity_duration $deceleration_curve;
144
box-shadow: inset 0 0 0 9999px transparent;
145
background-color: transparent;
146
background-image: radial-gradient(circle farthest-corner at center,
147
transparent 10%,
148
transparent 0%);
149
background-repeat: no-repeat;
150
background-position: center;
151
background-size: 1000% 1000%;
152
color: $secondary_fg_color;
153
}
154
155
@if $t == flat-hover {
156
box-shadow: inset 0 0 0 9999px $hover_overlay_color;
157
color: $fg_color;
158
}
159
160
@if $t == flat-active {
161
transition: $shorter_transition,
162
border-image $longer_duration $deceleration_curve,
163
background-size 0,
164
background-image 0;
165
animation: ripple_effect $longer_duration $deceleration_curve forwards;
166
box-shadow: inset 0 0 0 9999px $hover_overlay_color;
167
background-image: radial-gradient(circle farthest-corner at center,
168
$active_overlay_color 10%,
169
transparent 0%);
170
background-size: 0% 0%;
171
color: $fg_color;
172
}
173
174
@if $t == flat-disabled {
175
box-shadow: none;
176
background-color: transparent;
177
color: $disabled_secondary_fg_color;
178
}
179
180
@if $t == flat-checked {
181
background-color: $checked_overlay_color;
182
color: $fg_color;
183
}
184
185
@if $t == flat-checked-disabled {
186
background-color: $divider_color;
187
color: $disabled_fg_color;
188
}
189
}
190
191
192
@mixin overshoot($p) {
193
//
194
// overshoot
195
//
196
// $p: position
197
//
198
// possible $p values:
199
// top, bottom, right, left
200
//
201
202
$_position: center $p;
203
204
@if ($p == left) or ($p == right) {
205
$_position: $p center;
206
}
207
208
background-image: -gtk-gradient(radial,
209
$_position, 0,
210
$_position, 0.75,
211
to(rgba($primary_color, 0.24)),
212
to(transparent));
213
214
background-repeat: no-repeat;
215
background-position: $_position;
216
217
background-color: transparent; // reset some properties to be sure to not inherit them somehow
218
border: none; //
219
box-shadow: none; //
220
}
221
222
223
@mixin undershoot($p) {
224
//
225
// undershoot
226
//
227
// $p: position
228
//
229
// possible $p values:
230
// top, bottom, right, left
231
//
232
233
$_undershoot_color_dark: $track_color;
234
$_undershoot_color_light: rgba($base_color, 0.3);
235
236
$_gradient_dir: left;
237
$_dash_bg_size: 12px 1px;
238
$_gradient_repeat: repeat-x;
239
$_bg_pos: left $p;
240
241
@if ($p == left) or ($p == right) {
242
$_gradient_dir: top;
243
$_dash_bg_size: 1px 12px;
244
$_gradient_repeat: repeat-y;
245
$_bg_pos: $p top;
246
}
247
248
background-color: transparent; // shouldn't be needed, but better to be sure
249
250
background-image: linear-gradient(to $_gradient_dir, // this is the dashed line
251
$_undershoot_color_light 50%,
252
$_undershoot_color_dark 50%);
253
254
padding-#{$p}: 1px;
255
background-size: $_dash_bg_size;
256
background-repeat: $_gradient_repeat;
257
background-origin: content-box;
258
background-position: $_bg_pos;
259
}
260