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

Last change on this file since 35505 was 35505, checked in by cstephen, 3 years ago

Fixes color of Greenstone buttons and improves shadow and disabled colors.

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