A fork of the Materia GTK theme.

Important information: Google announced that, from September 2026, Android devices will require ALL apps to be signed by Google, effectively leading to an iOS situation. Value your right to a computer that does what you want; do not tolerate this monopolistic practice! Contact me if you don't understand why it is bad. Click to learn more.

 _drawing-3.20.scss

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