1 | ////
|
---|
2 | /// Defines themes that mimic the material design specification.
|
---|
3 | /// @author Carl Stephens
|
---|
4 | ////
|
---|
5 |
|
---|
6 | :root {
|
---|
7 | // Set these to adjust the colour palette
|
---|
8 | --primary-bg-color-l1: 36, 156, 207;
|
---|
9 | --primary-bg-color: 33, 145, 192;
|
---|
10 | --primary-fg-color: 255, 255, 255;
|
---|
11 |
|
---|
12 | --accent-bg-color: 25, 118, 158;
|
---|
13 | --accent-fg-color: 255, 255, 255;
|
---|
14 |
|
---|
15 | // Main font color
|
---|
16 | --body-color: rgb(39, 39, 39);
|
---|
17 | // For the paper style, but more generally the neutral background color
|
---|
18 | --paper-color: #FCFCFC;
|
---|
19 |
|
---|
20 | --primary-box-shadow: 0 2px 4px 0 #505050;
|
---|
21 | --primary-box-shadow-thin: 0 1px 3px 0 #666666;
|
---|
22 |
|
---|
23 | // The brightness to reduce participating elements to on hover
|
---|
24 | --hover-brightness: 92%;
|
---|
25 | --border-radius: 0.3em;
|
---|
26 | --transition-duration: 0.15s;
|
---|
27 |
|
---|
28 | // Default theme
|
---|
29 | @extend .theme-primary;
|
---|
30 | }
|
---|
31 |
|
---|
32 | /* === Start component definitions === */
|
---|
33 |
|
---|
34 | .paper {
|
---|
35 | padding: 1.2em;
|
---|
36 | border-radius: var(--border-radius);
|
---|
37 |
|
---|
38 | background-color: var(--paper-color);
|
---|
39 | color: var(--body-color);
|
---|
40 | box-shadow: var(--primary-box-shadow);
|
---|
41 | }
|
---|
42 |
|
---|
43 | .card {
|
---|
44 | @extend .paper;
|
---|
45 | box-shadow: var(--primary-box-shadow-thin);
|
---|
46 | }
|
---|
47 |
|
---|
48 | .card-outlined {
|
---|
49 | @extend .card;
|
---|
50 |
|
---|
51 | box-shadow: none;
|
---|
52 | border: 1px solid #BBB;
|
---|
53 | }
|
---|
54 |
|
---|
55 | .divider {
|
---|
56 | height: 1px;
|
---|
57 | background-color: #0000001F;
|
---|
58 | border: none;
|
---|
59 | margin: 1rem 2rem;
|
---|
60 | }
|
---|
61 |
|
---|
62 | /* Buttons */
|
---|
63 |
|
---|
64 | .btn-primary {
|
---|
65 | appearance: none;
|
---|
66 |
|
---|
67 | display: flex;
|
---|
68 | align-items: center;
|
---|
69 | text-align: left;
|
---|
70 |
|
---|
71 | background-color: var(--bg-color);
|
---|
72 | color: var(--fg-color);
|
---|
73 | border: none;
|
---|
74 | box-shadow: var(--primary-box-shadow-thin);
|
---|
75 | border-radius: var(--border-radius);
|
---|
76 | padding: 0.5em;
|
---|
77 |
|
---|
78 | cursor: pointer;
|
---|
79 | font-size: 1rem;
|
---|
80 | font-weight: 400;
|
---|
81 | text-decoration: none;
|
---|
82 |
|
---|
83 | transition-duration: var(--transition-duration);
|
---|
84 |
|
---|
85 | &:hover {
|
---|
86 | filter: brightness(var(--hover-brightness));
|
---|
87 | }
|
---|
88 |
|
---|
89 | &:disabled {
|
---|
90 | filter: grayscale(100%);
|
---|
91 | }
|
---|
92 | }
|
---|
93 |
|
---|
94 | .btn-fab {
|
---|
95 | @extend .btn-primary;
|
---|
96 |
|
---|
97 | border-radius: 50%;
|
---|
98 | padding: 0.3em;
|
---|
99 | }
|
---|
100 |
|
---|
101 | /** Text display/input */
|
---|
102 |
|
---|
103 | .text-container {
|
---|
104 | display: flex;
|
---|
105 | align-items: center;
|
---|
106 | flex-wrap: wrap;
|
---|
107 |
|
---|
108 | border-radius: var(--border-radius);
|
---|
109 | background: #DDD;
|
---|
110 | padding: 0.5em;
|
---|
111 | }
|
---|
112 |
|
---|
113 | .text-container-sl {
|
---|
114 | @extend .text-container;
|
---|
115 |
|
---|
116 | overflow-x: auto;
|
---|
117 | overflow-y: hidden;
|
---|
118 | white-space: nowrap;
|
---|
119 | }
|
---|
120 |
|
---|
121 | .text-input {
|
---|
122 | @extend .text-container;
|
---|
123 |
|
---|
124 | border-radius: var(--border-radius) var(--border-radius) 0 0;
|
---|
125 | border-bottom: 1px solid #AAA;
|
---|
126 | cursor: text;
|
---|
127 |
|
---|
128 | transition-duration: var(--transition-duration);
|
---|
129 |
|
---|
130 | &:hover {
|
---|
131 | background-color: #CDCDCD;
|
---|
132 | }
|
---|
133 |
|
---|
134 | &:active, &:focus {
|
---|
135 | border-bottom: 1px solid var(--bg-color);
|
---|
136 |
|
---|
137 | .text-input-active {
|
---|
138 | width: 100%;
|
---|
139 | }
|
---|
140 | }
|
---|
141 |
|
---|
142 | .text-input-active {
|
---|
143 | background-color: var(--bg-color);
|
---|
144 | height: 1px;
|
---|
145 | margin: 0 auto;
|
---|
146 | width: 0;
|
---|
147 | transition-duration: var(--transition-duration);
|
---|
148 | }
|
---|
149 | }
|
---|
150 |
|
---|
151 | .text-input-sl {
|
---|
152 | @extend .text-input;
|
---|
153 |
|
---|
154 | overflow-x: auto;
|
---|
155 | overflow-y: hidden;
|
---|
156 | white-space: nowrap;
|
---|
157 | }
|
---|
158 |
|
---|
159 | .text-placeholder {
|
---|
160 | color: #666;
|
---|
161 | cursor: inherit;
|
---|
162 | font-style: italic;
|
---|
163 | cursor: inherit;
|
---|
164 | user-select: none;
|
---|
165 | }
|
---|
166 |
|
---|
167 | /* Switches */
|
---|
168 |
|
---|
169 | // https://codepen.io/avstorm/pen/jOEpBLW
|
---|
170 | .switch
|
---|
171 | {
|
---|
172 | -webkit-appearance: none;
|
---|
173 | -moz-appearance: none;
|
---|
174 | appearance: none;
|
---|
175 |
|
---|
176 | -webkit-tap-highlight-color: transparent;
|
---|
177 | cursor: pointer;
|
---|
178 |
|
---|
179 | height: 16px;
|
---|
180 | width: 38px;
|
---|
181 | border-radius: 8px;
|
---|
182 | display: inline-block;
|
---|
183 | position: relative;
|
---|
184 | margin: 6px;
|
---|
185 | background-color: #c7c7c7;
|
---|
186 | transition-duration: var(--transition-duration);
|
---|
187 |
|
---|
188 | &:focus {
|
---|
189 | outline: 0;
|
---|
190 | }
|
---|
191 |
|
---|
192 | &::after {
|
---|
193 | content: '';
|
---|
194 | position: absolute;
|
---|
195 | display: inline-block;
|
---|
196 | top: -4px;
|
---|
197 | left: -4px;
|
---|
198 | width: 24px;
|
---|
199 | height: 24px;
|
---|
200 | border-radius: 50%;
|
---|
201 | background: white;
|
---|
202 | box-shadow: var(--primary-box-shadow-thin);
|
---|
203 | transition-duration: var(--transition-duration);
|
---|
204 | }
|
---|
205 |
|
---|
206 | &:checked {
|
---|
207 | background-color: rgba(var(--bg-color-raw), 0.4);
|
---|
208 |
|
---|
209 | &::after {
|
---|
210 | transform: translatex(22px);
|
---|
211 | background-color: var(--bg-color);
|
---|
212 | }
|
---|
213 | }
|
---|
214 | }
|
---|
215 |
|
---|
216 | /* Sliders */
|
---|
217 |
|
---|
218 | @mixin slider-clear {
|
---|
219 | appearance: none;
|
---|
220 | width: 100%; // Required for firefox
|
---|
221 |
|
---|
222 | &::-webkit-slider-thumb {
|
---|
223 | -webkit-appearance: none;
|
---|
224 | }
|
---|
225 |
|
---|
226 | &::-moz-range-track {
|
---|
227 | outline: none;
|
---|
228 | }
|
---|
229 |
|
---|
230 | &::-ms-track {
|
---|
231 | width: 100%;
|
---|
232 | background: transparent;
|
---|
233 | border-color: transparent;
|
---|
234 | color: transparent;
|
---|
235 | }
|
---|
236 | }
|
---|
237 |
|
---|
238 | @mixin slider-thumb {
|
---|
239 | height: 24px;
|
---|
240 | width: 24px;
|
---|
241 | border-radius: 50%;
|
---|
242 | cursor: pointer;
|
---|
243 |
|
---|
244 | background-color: var(--bg-color);
|
---|
245 | box-shadow: var(--primary-box-shadow-thin);
|
---|
246 |
|
---|
247 | &:hover {
|
---|
248 | filter: brightness(var(--hover-brightness));
|
---|
249 | }
|
---|
250 | }
|
---|
251 |
|
---|
252 | @mixin disabled-slider-thumb {
|
---|
253 | cursor: default;
|
---|
254 |
|
---|
255 | &:hover {
|
---|
256 | filter: none;
|
---|
257 | }
|
---|
258 | }
|
---|
259 |
|
---|
260 | .slider-continuous {
|
---|
261 | @include slider-clear();
|
---|
262 |
|
---|
263 | margin: 0;
|
---|
264 | padding: 0;
|
---|
265 | height: 8px;
|
---|
266 | border-radius: 4px;
|
---|
267 | background-color: rgba(var(--bg-color-raw), 0.3);
|
---|
268 |
|
---|
269 | transition-duration: var(--transition-duration);
|
---|
270 |
|
---|
271 | &::-webkit-slider-thumb {
|
---|
272 | @include slider-thumb()
|
---|
273 | }
|
---|
274 |
|
---|
275 | &::-moz-range-thumb {
|
---|
276 | @include slider-thumb()
|
---|
277 | }
|
---|
278 |
|
---|
279 | &::-ms-thumb {
|
---|
280 | @include slider-thumb()
|
---|
281 | }
|
---|
282 |
|
---|
283 | &:hover {
|
---|
284 | background-color: rgba(var(--bg-color-raw), 0.4);
|
---|
285 | }
|
---|
286 | }
|
---|
287 |
|
---|
288 | .slider-continuous:disabled {
|
---|
289 | filter: grayscale(100%);
|
---|
290 |
|
---|
291 | &::-webkit-slider-thumb {
|
---|
292 | @include disabled-slider-thumb();
|
---|
293 | }
|
---|
294 |
|
---|
295 | &::-moz-range-thumb {
|
---|
296 | @include disabled-slider-thumb();
|
---|
297 | }
|
---|
298 |
|
---|
299 | &::-ms-thumb {
|
---|
300 | @include disabled-slider-thumb();
|
---|
301 | }
|
---|
302 |
|
---|
303 | &:hover {
|
---|
304 | background-color: rgba(var(--bg-color-raw), 0.3);
|
---|
305 | }
|
---|
306 | }
|
---|
307 |
|
---|
308 | /* List Views */
|
---|
309 |
|
---|
310 | .list-view {
|
---|
311 | list-style-type: none;
|
---|
312 | margin-block: 0 0;
|
---|
313 | padding-inline: 0 0;
|
---|
314 | }
|
---|
315 |
|
---|
316 | .list-view__item {
|
---|
317 | padding: 0.2em 0.5em;
|
---|
318 | transition-duration: var(--transition-duration);
|
---|
319 |
|
---|
320 | &:hover {
|
---|
321 | background-color: #EEE;
|
---|
322 | }
|
---|
323 | }
|
---|
324 |
|
---|
325 | /* Progress Bars */
|
---|
326 |
|
---|
327 | .progress-circle-indeterminate {
|
---|
328 | height: 2em;
|
---|
329 | width: 2em;
|
---|
330 |
|
---|
331 | border: 0.25em solid var(--bg-color);
|
---|
332 | border-right: 0.25em solid rgba(var(--bg-color-raw), 0.3);
|
---|
333 | border-radius: 50%;
|
---|
334 |
|
---|
335 | animation: rotate360 1.5s linear 0s infinite running;
|
---|
336 | }
|
---|
337 |
|
---|
338 | @keyframes rotate360 {
|
---|
339 | 0% {
|
---|
340 | transform: rotate(0deg);
|
---|
341 | }
|
---|
342 |
|
---|
343 | 100% {
|
---|
344 | transform: rotate(360deg);
|
---|
345 | }
|
---|
346 | }
|
---|
347 |
|
---|
348 | .progress-bar-container {
|
---|
349 | width: 100%;
|
---|
350 | height: 8px;
|
---|
351 | overflow: hidden;
|
---|
352 |
|
---|
353 | background-color: rgba(var(--bg-color-raw), 0.2);
|
---|
354 | border-radius: 4px;
|
---|
355 | }
|
---|
356 |
|
---|
357 | .progress-bar-value {
|
---|
358 | height: 100%;
|
---|
359 |
|
---|
360 | background-color: var(--bg-color);
|
---|
361 | border-radius: 4px;
|
---|
362 | }
|
---|
363 |
|
---|
364 | .progress-bar-indeterminate {
|
---|
365 | width: 20%;
|
---|
366 | animation: 2s ease 0s infinite alternate prgbr-indeterminate;
|
---|
367 | }
|
---|
368 |
|
---|
369 | @keyframes prgbr-indeterminate {
|
---|
370 | 0% {
|
---|
371 | transform: translateX(-100%);
|
---|
372 | }
|
---|
373 |
|
---|
374 | 100% {
|
---|
375 | transform: translateX(500%);
|
---|
376 | }
|
---|
377 | }
|
---|
378 |
|
---|
379 | /* === End component definitions === */
|
---|
380 |
|
---|
381 | /* Font sizes */
|
---|
382 |
|
---|
383 | .body0 {
|
---|
384 | font-size: 18px;
|
---|
385 | line-height: 24px;
|
---|
386 | }
|
---|
387 |
|
---|
388 | .body1 {
|
---|
389 | font-size: 16px;
|
---|
390 | }
|
---|
391 |
|
---|
392 | .body2 {
|
---|
393 | font-size: 14px;
|
---|
394 | }
|
---|
395 |
|
---|
396 | .heading1 {
|
---|
397 | font-size: 40px;
|
---|
398 | font-weight: 300;
|
---|
399 | }
|
---|
400 |
|
---|
401 | /* Scrollbar replacement */
|
---|
402 |
|
---|
403 | ::-webkit-scrollbar {
|
---|
404 | width: 6px;
|
---|
405 | height: 6px;
|
---|
406 | }
|
---|
407 |
|
---|
408 | ::-webkit-scrollbar-track {
|
---|
409 | background: #f1f1f1;
|
---|
410 | }
|
---|
411 |
|
---|
412 | ::-webkit-scrollbar-thumb {
|
---|
413 | background: #CCC;
|
---|
414 | border-radius: 3px;
|
---|
415 |
|
---|
416 | transition-duration: var(--transition-duration);
|
---|
417 |
|
---|
418 | &:hover {
|
---|
419 | background: #666;
|
---|
420 | height: 8px;
|
---|
421 | width: 8px;
|
---|
422 | }
|
---|
423 | }
|
---|
424 |
|
---|
425 | /* === Start Theme Definitions === */
|
---|
426 |
|
---|
427 | .theme-primary {
|
---|
428 | --bg-color: rgb(var(--primary-bg-color));
|
---|
429 | --bg-color-raw: var(--primary-bg-color);
|
---|
430 | --fg-color: rgb(var(--primary-fg-color));
|
---|
431 | --fg-color-faw: var(--primary-fg-color);
|
---|
432 | }
|
---|
433 |
|
---|
434 | .theme-primary-l1 {
|
---|
435 | --bg-color: rgb(var(--primary-bg-color-l1));
|
---|
436 | --bg-color-raw: var(--primary-bg-color-l1);
|
---|
437 | --fg-color: rgb(var(--primary-fg-color));
|
---|
438 | --fg-color-raw: var(--primary-fg-color);
|
---|
439 | }
|
---|
440 |
|
---|
441 | .theme-error {
|
---|
442 | --bg-color: #f04848;
|
---|
443 | --bg-color-raw: 240, 72, 72;
|
---|
444 | }
|
---|
445 |
|
---|
446 | .theme-flat {
|
---|
447 | --bg-color: transparent;
|
---|
448 | --bg-color-raw: transparent;
|
---|
449 | --fg-color: rgb(var(--primary-bg-color));
|
---|
450 | --fg-color-raw: var(--primary-bg-color);
|
---|
451 |
|
---|
452 | box-shadow: none;
|
---|
453 |
|
---|
454 | &:hover {
|
---|
455 | --bg-color: rgba(var(--primary-bg-color), 0.15);
|
---|
456 | }
|
---|
457 | }
|
---|
458 |
|
---|
459 | .theme-accent {
|
---|
460 | --bg-color: rgb(var(--accent-bg-color));
|
---|
461 | --bg-color-raw: var(--accent-bg-color);
|
---|
462 | --fg-color: rgb(var(--accent-fg-color));
|
---|
463 | --fg-color-raw: var(--accent-fg-color);
|
---|
464 | }
|
---|
465 |
|
---|
466 | /* === End theme definitions === */ |
---|