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