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