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

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

Improve color theming

File size: 7.2 KB
Line 
1////
2/// Defines themes that mimic the material design specification.
3/// @author Carl Stephens
4////
5
6/* === Start theme definitions === */
7
8// When changing these the corresponding CSS variables must be updated
9$primary-bg-color-l1: #249ccf;
10$primary-bg-color: #2191c0;
11
12$accent-bg-color: #19769e;
13
14:root {
15 --primary-bg-color-l1: 36, 156, 207;
16 --primary-bg-color: 33, 145, 192;
17 --primary-fg-color: 255, 255, 255;
18
19 --accent-bg-color: 25, 118, 158;
20 --accent-fg-color: 255, 255, 255;
21
22 --body-color: rgb(39, 39, 39);
23
24 --primary-box-shadow: 0 2px 4px 0 #505050;
25 --primary-box-shadow-thin: 0 1px 3px 0 #666666;
26
27 --hover-brightness: 92%;
28
29 --paper-color: #FCFCFC;
30
31 --border-radius: 0.3em;
32
33 --transition-duration: 0.15s;
34
35 @extend .theme-primary;
36}
37
38/* === Start component definitions === */
39
40.paper {
41 padding: 1.2em;
42 border-radius: var(--border-radius);
43
44 background-color: var(--paper-color);
45 color: var(--body-color);
46 box-shadow: var(--primary-box-shadow);
47}
48
49.card {
50 @extend .paper;
51 box-shadow: var(--primary-box-shadow-thin);
52}
53
54.card-outlined {
55 @extend .card;
56
57 box-shadow: none;
58 border: 1px solid #BBB;
59}
60
61.divider {
62 height: 1px;
63 background-color: #0000001F;
64 border: none;
65 margin: 1rem 2rem;
66}
67
68/* Buttons */
69
70.btn-primary {
71 display: flex;
72 align-items: center;
73 text-align: left;
74
75 background-color: var(--bg-color);
76 color: var(--fg-color);
77 border: none;
78 box-shadow: var(--primary-box-shadow-thin);
79
80 border-radius: var(--border-radius);
81 padding: 0.5em;
82 cursor: pointer;
83 font-size: 16px;
84 text-decoration: none;
85 margin: 0 1px 3px 1px; /* Keeps space around the box shadow */
86
87 transition-duration: var(--transition-duration);
88
89 &:hover {
90 filter: brightness(var(--hover-brightness));
91 }
92
93 &:disabled {
94 filter: grayscale(100%);
95 }
96}
97
98.btn-fab {
99 @extend .btn-primary;
100
101 border-radius: 50%;
102 padding: 0.3em;
103}
104
105/** Text display/input */
106
107.text-container {
108 display: flex;
109 align-items: center;
110 flex-wrap: wrap;
111
112 border-radius: var(--border-radius);
113 background: #DDD;
114 padding: 0.5em;
115}
116
117.text-container-sl {
118 @extend .text-container;
119
120 overflow-x: auto;
121 overflow-y: hidden;
122 white-space: nowrap;
123}
124
125.text-input {
126 @extend .text-container;
127
128 border-radius: var(--border-radius) var(--border-radius) 0 0;
129 border-bottom: 1px solid #AAA;
130 cursor: text;
131
132 transition-duration: var(--transition-duration);
133
134 &:hover {
135 background-color: #CDCDCD;
136 }
137
138 &:active, &:focus {
139 border-bottom: 1px solid var(--bg-color);
140
141 .text-input-active {
142 width: 100%;
143 }
144 }
145
146 .text-input-active {
147 background-color: var(--bg-color);
148 height: 1px;
149 margin: 0 auto;
150 width: 0;
151 transition-duration: var(--transition-duration);
152 }
153}
154
155.text-input-sl {
156 @extend .text-input;
157
158 overflow-x: auto;
159 overflow-y: hidden;
160 white-space: nowrap;
161}
162
163.text-placeholder {
164 color: #666;
165 cursor: inherit;
166 font-style: italic;
167 cursor: inherit;
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: scale-color($primary-bg-color-l1, $alpha: -60%);
211
212 &::after {
213 transform: translatex(22px);
214 background-color: var(--primary-bg-color-l1);
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
258 &:hover {
259 filter: none;
260 }
261}
262
263.slider-continuous {
264 @include slider-clear();
265
266 margin: 0;
267 padding: 0;
268 height: 8px;
269 border-radius: 4px;
270 background-color: scale-color($primary-bg-color-l1, $alpha: -70%);
271
272 transition-duration: var(--transition-duration);
273
274 &::-webkit-slider-thumb {
275 @include slider-thumb()
276 }
277
278 &::-moz-range-thumb {
279 @include slider-thumb()
280 }
281
282 &::-ms-thumb {
283 @include slider-thumb()
284 }
285
286 &:hover {
287 background-color: scale-color($primary-bg-color-l1, $alpha: -60%);
288 }
289}
290
291.slider-continuous:disabled {
292 filter: grayscale(100%);
293
294 &::-webkit-slider-thumb {
295 @include disabled-slider-thumb();
296 }
297
298 &::-moz-range-thumb {
299 @include disabled-slider-thumb();
300 }
301
302 &::-ms-thumb {
303 @include disabled-slider-thumb();
304 }
305
306 &:hover {
307 background-color: scale-color($primary-bg-color-l1, $alpha: -70%);
308 }
309}
310
311/* List Views */
312
313.list-view {
314 list-style-type: none;
315 margin-block: 0 0;
316 padding-inline: 0 0;
317}
318
319.list-view__item {
320 padding: 0.2em 0.5em;
321 transition-duration: var(--transition-duration);
322
323 &:hover {
324 background-color: #EEE;
325 }
326}
327
328/* === End component definitions === */
329
330/* Font sizes */
331
332.body0 {
333 font-size: 18px;
334 line-height: 24px;
335}
336
337.body1 {
338 font-size: 16px;
339}
340
341.body2 {
342 font-size: 14px;
343}
344
345.heading1 {
346 font-size: 40px;
347 font-weight: 300;
348}
349
350/* Scrollbar replacement */
351
352::-webkit-scrollbar {
353 width: 6px;
354 height: 6px;
355}
356
357::-webkit-scrollbar-track {
358 background: #f1f1f1;
359}
360
361::-webkit-scrollbar-thumb {
362 background: #CCC;
363 border-radius: 3px;
364
365 transition-duration: var(--transition-duration);
366
367 &:hover {
368 background: #666;
369 height: 8px;
370 width: 8px;
371 }
372}
373
374/* === Start Theme Definitions === */
375
376.theme-primary {
377 --bg-color: rgb(var(--primary-bg-color));
378 --fg-color: rgb(var(--primary-fg-color));
379}
380
381.theme-primary-l1 {
382 --bg-color: rgb(var(--primary-bg-color-l1));
383 --fg-color: rgb(var(--primary-fg-color));
384}
385
386.theme-error {
387 --bg-color: #f04848;
388}
389
390.theme-flat {
391 --bg-color: transparent;
392 --fg-color: rgb(var(--primary-bg-color));
393
394 box-shadow: none;
395
396 &:hover {
397 --bg-color: rgba(var(--primary-bg-color), 0.15);//#EEE;
398 }
399}
400
401.theme-accent {
402 --bg-color: rgb(var(--accent-bg-color));
403 --fg-color: rgb(var(--accent-fg-color));
404}
405
406/* === End theme definitions === */
Note: See TracBrowser for help on using the repository browser.