1 | ////
|
---|
2 | /// Defines themes that mimic the material design specification.
|
---|
3 | /// @author Carl Stephens
|
---|
4 | ////
|
---|
5 |
|
---|
6 | /* === Start theme definitions === */
|
---|
7 |
|
---|
8 | $primary-bg-color-l1: #249ccf;
|
---|
9 | $primary-bg-color: #2191c0;
|
---|
10 |
|
---|
11 | $accent-bg-color: #19769e;//rgb(240, 176, 0);
|
---|
12 |
|
---|
13 | :root {
|
---|
14 | --primary-bg-color-l1: #{$primary-bg-color-l1};
|
---|
15 | --primary-bg-color: #{$primary-bg-color};
|
---|
16 | --primary-fg-color: white;
|
---|
17 |
|
---|
18 | --accent-bg-color: #{$accent-bg-color};
|
---|
19 | --accent-fg-color: white;//rgb(61, 61, 61);
|
---|
20 |
|
---|
21 | --body-color: rgb(39, 39, 39);
|
---|
22 |
|
---|
23 | --primary-box-shadow: 0px 2px 4px 0px #505050;
|
---|
24 | --primary-box-shadow-thin: 0px 1px 3px 0px #747474;
|
---|
25 | --hover-brightness: 92%;
|
---|
26 |
|
---|
27 | --paper-color: #FCFCFC;
|
---|
28 |
|
---|
29 | --border-radius: 0.3em;
|
---|
30 |
|
---|
31 | --transition-duration: 0.15s;
|
---|
32 | }
|
---|
33 |
|
---|
34 | .theme-error {
|
---|
35 | --primary-bg-color: #f04848;
|
---|
36 | --primary-fg-color: white;
|
---|
37 | }
|
---|
38 |
|
---|
39 | .theme-flat {
|
---|
40 | --primary-bg-color: transparent;
|
---|
41 | --primary-fg-color: #{$primary-bg-color};
|
---|
42 | --primary-box-shadow: none;
|
---|
43 |
|
---|
44 | &:hover {
|
---|
45 | background-color: #EEE;
|
---|
46 | }
|
---|
47 | }
|
---|
48 |
|
---|
49 | .theme-accent {
|
---|
50 | --primary-bg-color: var(--accent-bg-color);
|
---|
51 | --primary-fg-color: var(--accent-fg-color);
|
---|
52 | }
|
---|
53 |
|
---|
54 | .border-accent {
|
---|
55 | border: 2px var(--accent-bg-color) solid;
|
---|
56 | }
|
---|
57 |
|
---|
58 | /* === End theme definitions */
|
---|
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 |
|
---|
74 | box-shadow: var(--primary-box-shadow-thin);
|
---|
75 | }
|
---|
76 |
|
---|
77 | .card-outlined {
|
---|
78 | @extend .card;
|
---|
79 |
|
---|
80 | box-shadow: none;
|
---|
81 | border: 1px solid #BBB;
|
---|
82 | }
|
---|
83 |
|
---|
84 | .divider {
|
---|
85 | height: 1px;
|
---|
86 | background-color: #0000001F;
|
---|
87 | border: none;
|
---|
88 | margin: 1rem 2rem;
|
---|
89 | }
|
---|
90 |
|
---|
91 | /* Buttons */
|
---|
92 |
|
---|
93 | .btn-primary {
|
---|
94 | display: flex;
|
---|
95 | align-items: center;
|
---|
96 |
|
---|
97 | background-color: var(--primary-bg-color);
|
---|
98 | color: var(--primary-fg-color);
|
---|
99 | border: none;
|
---|
100 | box-shadow: var(--primary-box-shadow);
|
---|
101 |
|
---|
102 | border-radius: var(--border-radius);
|
---|
103 | padding: 0.5em;
|
---|
104 | cursor: pointer;
|
---|
105 | font-size: 16px;
|
---|
106 | text-decoration: none;
|
---|
107 | margin: 0 1px 3px 1px; /* Keeps space around the box shadow */
|
---|
108 |
|
---|
109 | transition-duration: var(--transition-duration);
|
---|
110 |
|
---|
111 | &:hover {
|
---|
112 | filter: brightness(var(--hover-brightness));
|
---|
113 | }
|
---|
114 |
|
---|
115 | &:disabled {
|
---|
116 | filter: grayscale(100%);
|
---|
117 | }
|
---|
118 | }
|
---|
119 |
|
---|
120 | .btn-fab {
|
---|
121 | @extend .btn-primary;
|
---|
122 |
|
---|
123 | border-radius: 50%;
|
---|
124 | padding: 0.3em;
|
---|
125 | }
|
---|
126 |
|
---|
127 | /** Text display/input */
|
---|
128 |
|
---|
129 | .text-container {
|
---|
130 | display: flex;
|
---|
131 | align-items: center;
|
---|
132 |
|
---|
133 | border-radius: var(--border-radius);
|
---|
134 | background: #DDD;
|
---|
135 | padding: 0.5em;
|
---|
136 |
|
---|
137 | .text-placeholder {
|
---|
138 | cursor: default;
|
---|
139 | }
|
---|
140 | }
|
---|
141 |
|
---|
142 | .text-container-sl {
|
---|
143 | @extend .text-container;
|
---|
144 |
|
---|
145 | overflow-x: auto;
|
---|
146 | overflow-y: hidden;
|
---|
147 | white-space: nowrap;
|
---|
148 | }
|
---|
149 |
|
---|
150 | .text-input {
|
---|
151 | @extend .text-container;
|
---|
152 |
|
---|
153 | border-radius: var(--border-radius) var(--border-radius) 0 0;
|
---|
154 | border-bottom: 1px solid #AAA;
|
---|
155 | cursor: text;
|
---|
156 |
|
---|
157 | transition-duration: var(--transition-duration);
|
---|
158 |
|
---|
159 | &:hover {
|
---|
160 | background-color: #CDCDCD;
|
---|
161 | }
|
---|
162 |
|
---|
163 | &:active, &:focus {
|
---|
164 | border-bottom: 1px solid var(--primary-bg-color);
|
---|
165 |
|
---|
166 | .text-input-active {
|
---|
167 | width: 100%;
|
---|
168 | }
|
---|
169 | }
|
---|
170 |
|
---|
171 | .text-input-active {
|
---|
172 | background-color: var(--primary-bg-color);
|
---|
173 | height: 1px;
|
---|
174 | margin: 0 auto;
|
---|
175 | width: 0;
|
---|
176 | transition-duration: var(--transition-duration);
|
---|
177 | }
|
---|
178 | }
|
---|
179 |
|
---|
180 | .text-input-sl {
|
---|
181 | @extend .text-input;
|
---|
182 |
|
---|
183 | overflow-x: auto;
|
---|
184 | overflow-y: hidden;
|
---|
185 | white-space: nowrap;
|
---|
186 | }
|
---|
187 |
|
---|
188 | .text-placeholder {
|
---|
189 | color: #666;
|
---|
190 | cursor: default;
|
---|
191 | font-style: italic;
|
---|
192 | cursor: inherit;
|
---|
193 | }
|
---|
194 |
|
---|
195 | /* Switches */
|
---|
196 |
|
---|
197 | // https://codepen.io/avstorm/pen/jOEpBLW
|
---|
198 | .switch
|
---|
199 | {
|
---|
200 | -webkit-appearance: none;
|
---|
201 | -moz-appearance: none;
|
---|
202 | appearance: none;
|
---|
203 |
|
---|
204 | -webkit-tap-highlight-color: transparent;
|
---|
205 | cursor: pointer;
|
---|
206 |
|
---|
207 | height: 16px;
|
---|
208 | width: 38px;
|
---|
209 | border-radius: 8px;
|
---|
210 | display: inline-block;
|
---|
211 | position: relative;
|
---|
212 | margin: 6px;
|
---|
213 | background-color: #c7c7c7;
|
---|
214 | transition-duration: var(--transition-duration);
|
---|
215 |
|
---|
216 | &:focus {
|
---|
217 | outline: 0;
|
---|
218 | }
|
---|
219 |
|
---|
220 | &::after {
|
---|
221 | content: '';
|
---|
222 | position: absolute;
|
---|
223 | display: inline-block;
|
---|
224 | top: -4px;
|
---|
225 | left: -4px;
|
---|
226 | width: 24px;
|
---|
227 | height: 24px;
|
---|
228 | border-radius: 50%;
|
---|
229 | background: white;
|
---|
230 | box-shadow: var(--primary-box-shadow-thin);
|
---|
231 | transition-duration: var(--transition-duration);
|
---|
232 | }
|
---|
233 |
|
---|
234 | &:checked {
|
---|
235 | background-color: scale-color($primary-bg-color-l1, $alpha: -60%);
|
---|
236 |
|
---|
237 | &::after {
|
---|
238 | transform: translatex(22px);
|
---|
239 | background-color: var(--primary-bg-color-l1);
|
---|
240 | }
|
---|
241 | }
|
---|
242 | }
|
---|
243 |
|
---|
244 | /* Sliders */
|
---|
245 |
|
---|
246 | @mixin slider-clear {
|
---|
247 | appearance: none;
|
---|
248 | width: 100%; // Required for firefox
|
---|
249 |
|
---|
250 | &:focus {
|
---|
251 | outline: none;
|
---|
252 | }
|
---|
253 |
|
---|
254 | &::-webkit-slider-thumb {
|
---|
255 | -webkit-appearance: none;
|
---|
256 | }
|
---|
257 |
|
---|
258 | &::-moz-range-track {
|
---|
259 | outline: none;
|
---|
260 | }
|
---|
261 |
|
---|
262 | &::-ms-track {
|
---|
263 | width: 100%;
|
---|
264 | background: transparent;
|
---|
265 | border-color: transparent;
|
---|
266 | color: transparent;
|
---|
267 | }
|
---|
268 | }
|
---|
269 |
|
---|
270 | @mixin slider-thumb {
|
---|
271 | height: 24px;
|
---|
272 | width: 24px;
|
---|
273 | border-radius: 50%;
|
---|
274 | cursor: pointer;
|
---|
275 |
|
---|
276 | background-color: var(--primary-bg-color);
|
---|
277 | box-shadow: var(--primary-box-shadow-thin);
|
---|
278 |
|
---|
279 | &:hover {
|
---|
280 | filter: brightness(var(--hover-brightness));
|
---|
281 | }
|
---|
282 | }
|
---|
283 |
|
---|
284 | @mixin disabled-slider-thumb {
|
---|
285 | cursor: default;
|
---|
286 |
|
---|
287 | &:hover {
|
---|
288 | filter: none;
|
---|
289 | }
|
---|
290 | }
|
---|
291 |
|
---|
292 | .slider-continuous {
|
---|
293 | @include slider-clear();
|
---|
294 |
|
---|
295 | margin: 0;
|
---|
296 | padding: 0;
|
---|
297 | height: 8px;
|
---|
298 | border-radius: 4px;
|
---|
299 | background-color: scale-color($primary-bg-color-l1, $alpha: -70%);
|
---|
300 |
|
---|
301 | transition-duration: var(--transition-duration);
|
---|
302 |
|
---|
303 | &::-webkit-slider-thumb {
|
---|
304 | @include slider-thumb()
|
---|
305 | }
|
---|
306 |
|
---|
307 | &::-moz-range-thumb {
|
---|
308 | @include slider-thumb()
|
---|
309 | }
|
---|
310 |
|
---|
311 | &::-ms-thumb {
|
---|
312 | @include slider-thumb()
|
---|
313 | }
|
---|
314 |
|
---|
315 | &:hover {
|
---|
316 | background-color: scale-color($primary-bg-color-l1, $alpha: -60%);
|
---|
317 | }
|
---|
318 | }
|
---|
319 |
|
---|
320 | .slider-continuous:disabled {
|
---|
321 | filter: grayscale(100%);
|
---|
322 |
|
---|
323 | &::-webkit-slider-thumb {
|
---|
324 | @include disabled-slider-thumb();
|
---|
325 | }
|
---|
326 |
|
---|
327 | &::-moz-range-thumb {
|
---|
328 | @include disabled-slider-thumb();
|
---|
329 | }
|
---|
330 |
|
---|
331 | &::-ms-thumb {
|
---|
332 | @include disabled-slider-thumb();
|
---|
333 | }
|
---|
334 |
|
---|
335 | &:hover {
|
---|
336 | background-color: scale-color($primary-bg-color-l1, $alpha: -70%);
|
---|
337 | }
|
---|
338 | }
|
---|
339 |
|
---|
340 | /* List Views */
|
---|
341 |
|
---|
342 | .list-view {
|
---|
343 | list-style-type: none;
|
---|
344 | margin-block: 0 0;
|
---|
345 | padding-inline: 0 0;
|
---|
346 | }
|
---|
347 |
|
---|
348 | .list-view__item {
|
---|
349 | padding: 0.2em 0.5em;
|
---|
350 | transition-duration: var(--transition-duration);
|
---|
351 |
|
---|
352 | &:hover {
|
---|
353 | background-color: #EEE;
|
---|
354 | }
|
---|
355 | }
|
---|
356 |
|
---|
357 | /* === End component definitions === */
|
---|
358 |
|
---|
359 | /* Font sizes */
|
---|
360 |
|
---|
361 | .body0 {
|
---|
362 | font-size: 18px;
|
---|
363 | line-height: 24px;
|
---|
364 | }
|
---|
365 |
|
---|
366 | .body1 {
|
---|
367 | font-size: 16px;
|
---|
368 | }
|
---|
369 |
|
---|
370 | .body2 {
|
---|
371 | font-size: 14px;
|
---|
372 | }
|
---|
373 |
|
---|
374 | .heading1 {
|
---|
375 | font-size: 40px;
|
---|
376 | font-weight: 300;
|
---|
377 | }
|
---|
378 |
|
---|
379 | /* Scrollbar replacement */
|
---|
380 |
|
---|
381 | ::-webkit-scrollbar {
|
---|
382 | width: 6px;
|
---|
383 | height: 6px;
|
---|
384 | }
|
---|
385 |
|
---|
386 | ::-webkit-scrollbar-track {
|
---|
387 | background: #f1f1f1;
|
---|
388 | }
|
---|
389 |
|
---|
390 | ::-webkit-scrollbar-thumb {
|
---|
391 | background: #CCC;
|
---|
392 | border-radius: 3px;
|
---|
393 |
|
---|
394 | transition-duration: var(--transition-duration);
|
---|
395 |
|
---|
396 | &:hover {
|
---|
397 | background: #666;
|
---|
398 | height: 8px;
|
---|
399 | width: 8px;
|
---|
400 | }
|
---|
401 | } |
---|