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.97 kiB
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 == normal {
38
transition: $longer_transition, $shadow_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 == focus {
46
border-image: none;
47
box-shadow: $shadow_2;
48
}
49
50
@if $t == disabled {
51
box-shadow: $shadow_1;
52
background-color: $alt_base_color;
53
color: $disabled_fg_color;
54
}
55
56
@if $t == flat-normal {
57
transition: $longer_transition;
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: transparent;
64
color: $fg_color;
65
}
66
67
@if $t == flat-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 == flat-disabled {
76
box-shadow: inset 0 -1px $divider_color;
77
background-color: transparent;
78
color: $disabled_fg_color;
79
}
80
}
81
82
83
@mixin button($t, $c: $button_bg_color) {
84
//
85
// button
86
//
87
// $t: button type
88
// $c: base color
89
//
90
91
@if $t == normal {
92
transition: $longer_transition,
93
$shadow_transition,
94
background-size $ripple_duration $deceleration_curve,
95
background-image $ripple_opacity_duration $deceleration_curve;
96
box-shadow: $shadow_1, inset 0 0 0 9999px transparent;
97
background-color: $c;
98
background-image: radial-gradient(circle farthest-corner at center,
99
transparent 10%,
100
transparent 0%);
101
background-repeat: no-repeat;
102
background-position: center;
103
background-size: 1000% 1000%;
104
color: $button_fg_color;
105
}
106
107
@if $t == hover {
108
box-shadow: $shadow_2, inset 0 0 0 9999px transparent;
109
color: $fg_color;
110
}
111
112
@if $t == active {
113
transition: $longer_transition,
114
background-size 0,
115
background-image 0;
116
animation: ripple_effect $longer_duration $deceleration_curve forwards;
117
box-shadow: $shadow_2, inset 0 0 0 9999px $semi_fill_color;
118
background-image: radial-gradient(circle farthest-corner at center,
119
$semi_fill_color 10%,
120
transparent 0%);
121
background-size: 0% 0%;
122
color: $fg_color;
123
}
124
125
@if $t == disabled {
126
box-shadow: none;
127
background-color: $divider_color;
128
color: if($c == $button_bg_color, $disabled_secondary_fg_color, $disabled_fg_color);
129
}
130
131
@if $t == checked {
132
background-color: $primary_color;
133
color: $inverse_fg_color;
134
}
135
136
@if $t == checked-disabled {
137
background-color: rgba($primary_color, 0.3);
138
color: rgba($primary_color, 0.5);
139
}
140
141
@if $t == flat-normal {
142
transition: $longer_transition,
143
background-size $ripple_duration $deceleration_curve,
144
background-image $ripple_opacity_duration $deceleration_curve;
145
box-shadow: inset 0 0 0 9999px transparent;
146
background-color: transparent;
147
background-image: radial-gradient(circle farthest-corner at center,
148
transparent 10%,
149
transparent 0%);
150
background-repeat: no-repeat;
151
background-position: center;
152
background-size: 1000% 1000%;
153
color: $secondary_fg_color;
154
}
155
156
@if $t == flat-hover {
157
box-shadow: inset 0 0 0 9999px $semi_fill_color;
158
color: $fg_color;
159
}
160
161
@if $t == flat-active {
162
transition: $longer_transition,
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 $semi_fill_color;
167
background-image: radial-gradient(circle farthest-corner at center,
168
$semi_fill_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: if($c == $button_bg_color, $disabled_secondary_fg_color, $disabled_fg_color);
178
}
179
180
@if $t == flat-checked {
181
background-color: $fill_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($alt_primary_color, 0.3)),
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