_drawing.scss
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
// Reference URL:
15
// https://material.google.com/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, rgba($base_color, 0.01), rgba($bg_color, 0.01));
100
border-color: transparent;
101
box-shadow: inset 0 -1px if($fc == $primary_color, $fill_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
}
111
112
@if $t == insensitive {
113
color: $disabled_fg_color;
114
border-color: transparent;
115
box-shadow: inset 0 -1px if($fc == $primary_color, $disabled_fill_color, $fc);
116
}
117
}
118
119
120
@mixin button($t, $c: $base_color, $tc: $fg_color) {
121
//
122
// button
123
//
124
// $t: button type
125
// $c: base color
126
// $tc: text color
127
//
128
129
@if $t == normal {
130
color: if($tc == $fg_color, $secondary_fg_color, $tc);
131
background-color: $c;
132
border-color: transparent;
133
box-shadow: $shadow_1;
134
text-shadow: none;
135
icon-shadow: none;
136
}
137
138
@if $t == focus {
139
color: $tc;
140
text-shadow: none;
141
icon-shadow: none;
142
box-shadow: $shadow_0;
143
// box-shadow: inset 0px 0px 0px 2px $fill_color;
144
}
145
146
@if $t == hover {
147
color: $tc;
148
background-color: $c;
149
border-color: transparent;
150
box-shadow: $shadow_2;
151
text-shadow: none;
152
icon-shadow: none;
153
}
154
155
@if $t == active {
156
color: $tc;
157
background-color: mix($tc, $c, percentage($lower_opacity));
158
border-color: transparent;
159
box-shadow: $shadow_2;
160
text-shadow: none;
161
icon-shadow: none;
162
}
163
164
@if $t == insensitive {
165
color: if($tc == $fg_color, $disabled_secondary_fg_color, $tc);
166
background-color: if($c == $base_color, $disabled_fill_color, $c);
167
border-color: transparent;
168
box-shadow: $shadow_0;
169
text-shadow: none;
170
icon-shadow: none;
171
}
172
173
@if $t == flat-normal {
174
color: if($tc != $inverse_fg_color, $secondary_fg_color, $secondary_inverse_fg_color);
175
background-color: transparent;
176
border-color: transparent;
177
box-shadow: $shadow_0;
178
text-shadow: none;
179
icon-shadow: none;
180
}
181
182
@if $t == flat-focus {
183
color: if($tc != $inverse_fg_color, $fg_color, $inverse_fg_color);
184
text-shadow: none;
185
icon-shadow: none;
186
box-shadow: $shadow_0;
187
// box-shadow: inset 0px 0px 0px 2px $fill_color;
188
}
189
190
@if $t == flat-hover {
191
color: if($tc != $inverse_fg_color, $fg_color, $inverse_fg_color);
192
background-color: if($tc != $inverse_fg_color, $semi_fill_color, $semi_inverse_fill_color);
193
border-color: transparent;
194
box-shadow: $shadow_0;
195
text-shadow: none;
196
icon-shadow: none;
197
}
198
199
@if $t == flat-active {
200
color: if($tc != $inverse_fg_color, $fg_color, $inverse_fg_color);
201
background-color: if($tc != $inverse_fg_color, $fill_color, $inverse_fill_color);
202
border-color: transparent;
203
box-shadow: $shadow_0;
204
text-shadow: none;
205
icon-shadow: none;
206
}
207
208
@if $t == flat-insensitive {
209
color: if($tc != $inverse_fg_color, $disabled_secondary_fg_color, $disabled_secondary_inverse_fg_color);
210
background-color: transparent;
211
border-color: transparent;
212
box-shadow: $shadow_0;
213
text-shadow: none;
214
icon-shadow: none;
215
}
216
}
217