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.scss

View raw Download
text/plain • 4.81 kiB
ASCII text
        
            
1
// generic drawing of more complex things
2
3
// provide font size in pt, with px fallback
4
@function pt($size: $root-font-size) {
5
@return ($size * 0.75 / 1px) + pt;
6
}
7
8
// provide icon size in em, with px fallback
9
@function em($size: 16px) {
10
@return ($size / $root-font-size) + em;
11
}
12
13
// Typography
14
// based on:
15
// https://material.io/guidelines/style/typography.html#typography-styles
16
17
@mixin font($size) {
18
@if $size == display-4 {
19
// font-family: $large-font-family;
20
font-size: 112px;
21
font-weight: 300;
22
// line-height: 1;
23
}
24
25
@if $size == display-3 {
26
// font-family: $large-font-family;
27
font-size: 56px;
28
font-weight: 400;
29
// line-height: 1;
30
}
31
32
@if $size == display-2 {
33
// font-family: $large-font-family;
34
font-size: 45px;
35
font-weight: 400;
36
// line-height: 48px;
37
}
38
39
@if $size == display-1 {
40
// font-family: $large-font-family;
41
font-size: 34px;
42
font-weight: 400;
43
// line-height: 40px;
44
}
45
46
@if $size == headline {
47
font-size: pt(24px);
48
font-weight: 400;
49
// line-height: 32px;
50
}
51
52
@if $size == title {
53
font-size: pt(20px);
54
font-weight: 500;
55
// line-height: 1;
56
}
57
58
@if $size == subheading {
59
font-size: pt($subheading-size);
60
font-weight: 400;
61
// line-height: 24px;
62
}
63
64
@if $size == body-2 {
65
font-size: pt($root-font-size);
66
font-weight: 500;
67
// line-height: 24px;
68
}
69
70
@if $size == body-1 {
71
font-size: pt($root-font-size);
72
font-weight: 400;
73
// line-height: 20px;
74
}
75
76
@if $size == caption {
77
font-size: pt(12px);
78
font-weight: 400;
79
// line-height: 1;
80
}
81
82
@if $size == button {
83
font-size: pt($root-font-size);
84
font-weight: 500;
85
// line-height: 20px;
86
}
87
}
88
89
90
@mixin entry($t, $fc: $primary_color) {
91
//
92
// entry
93
//
94
// $t: entry type
95
// $fc: focus color
96
//
97
98
@if $t == normal {
99
background-color: if($fc == $primary_color, $fill_color, $inverse_fill_color);
100
border-color: transparent;
101
box-shadow: inset 0 -1px if($fc == $primary_color, $track_color, $fc);
102
}
103
104
@if $t == focus {
105
border-color: transparent;
106
box-shadow: inset 0 -2px $fc;
107
}
108
109
@if $t == hover {
110
box-shadow: inset 0 -1px if($fc == $primary_color, $fg_color, $fc);
111
}
112
113
@if $t == insensitive {
114
color: $disabled_fg_color;
115
border-color: transparent;
116
box-shadow: inset 0 -1px if($fc == $primary_color, $divider_color, $fc);
117
}
118
}
119
120
121
@mixin button($t, $c: $button_bg_color, $tc: $fg_color) {
122
//
123
// button
124
//
125
// $t: button type
126
// $c: base color
127
// $tc: text color
128
//
129
130
@if $t == normal {
131
color: if($tc == $fg_color, $button_fg_color, $tc);
132
background-color: $c;
133
border-color: transparent;
134
box-shadow: $shadow_1;
135
text-shadow: none;
136
icon-shadow: none;
137
}
138
139
@if $t == focus {
140
color: $tc;
141
text-shadow: none;
142
icon-shadow: none;
143
box-shadow: $shadow_0;
144
// box-shadow: inset 0px 0px 0px 2px $divider_color;
145
}
146
147
@if $t == hover {
148
color: $tc;
149
background-color: $c;
150
border-color: transparent;
151
box-shadow: $shadow_2;
152
text-shadow: none;
153
icon-shadow: none;
154
}
155
156
@if $t == active {
157
color: $tc;
158
background-color: mix($tc, $c, percentage(0.24));
159
border-color: transparent;
160
box-shadow: $shadow_2;
161
text-shadow: none;
162
icon-shadow: none;
163
}
164
165
@if $t == insensitive {
166
color: if($tc == $fg_color, $disabled_secondary_fg_color, $tc);
167
background-color: if($c == $button_bg_color, $divider_color, $c);
168
border-color: transparent;
169
box-shadow: $shadow_0;
170
text-shadow: none;
171
icon-shadow: none;
172
}
173
174
@if $t == flat-normal {
175
color: if($tc != $inverse_fg_color, $secondary_fg_color, $inverse_secondary_fg_color);
176
background-color: transparent;
177
border-color: transparent;
178
box-shadow: $shadow_0;
179
text-shadow: none;
180
icon-shadow: none;
181
}
182
183
@if $t == flat-focus {
184
color: if($tc != $inverse_fg_color, $fg_color, $inverse_fg_color);
185
text-shadow: none;
186
icon-shadow: none;
187
box-shadow: $shadow_0;
188
// box-shadow: inset 0px 0px 0px 2px $divider_color;
189
}
190
191
@if $t == flat-hover {
192
color: if($tc != $inverse_fg_color, $fg_color, $inverse_fg_color);
193
background-color: if($tc != $inverse_fg_color, $divider_color, $inverse_divider_color);
194
border-color: transparent;
195
box-shadow: $shadow_0;
196
text-shadow: none;
197
icon-shadow: none;
198
}
199
200
@if $t == flat-active {
201
color: if($tc != $inverse_fg_color, $fg_color, $inverse_fg_color);
202
background-color: if($tc != $inverse_fg_color, $track_color, $inverse_track_color);
203
border-color: transparent;
204
box-shadow: $shadow_0;
205
text-shadow: none;
206
icon-shadow: none;
207
}
208
209
@if $t == flat-insensitive {
210
color: if($tc != $inverse_fg_color, $disabled_secondary_fg_color, $inverse_disabled_secondary_fg_color);
211
background-color: transparent;
212
border-color: transparent;
213
box-shadow: $shadow_0;
214
text-shadow: none;
215
icon-shadow: none;
216
}
217
}
218