source: main/trunk/model-interfaces-dev/atea/macron-restoration/src/styles/_material.scss@ 35718

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

Implement download support

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