source: main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/styles/_material.scss@ 35899

Last change on this file since 35899 was 35899, checked in by cstephen, 2 years ago

Allow uploaded files to be removed before transcribing

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