matcha-theme 20.188.0 → 20.189.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,26 +17,18 @@
17
17
  // @param $primary
18
18
  // @param $lighter
19
19
  @function palette($base-palette, $default: 500, $lighter: 100, $darker: 700) {
20
- $result: map.merge(
21
- $base-palette,
22
- (
23
- default: map.get($base-palette, $default),
24
- lighter: map.get($base-palette, $lighter),
25
- darker: map.get($base-palette, $darker),
26
- default-contrast: map-contrast($base-palette, $default),
27
- lighter-contrast: map-contrast($base-palette, $lighter),
28
- darker-contrast: map-contrast($base-palette, $darker)
29
- )
30
- );
20
+ $result: map.merge($base-palette,
21
+ (default: map.get($base-palette, $default),
22
+ lighter: map.get($base-palette, $lighter),
23
+ darker: map.get($base-palette, $darker),
24
+ default-contrast: map-contrast($base-palette, $default),
25
+ lighter-contrast: map-contrast($base-palette, $lighter),
26
+ darker-contrast: map-contrast($base-palette, $darker)));
31
27
 
32
28
  // For each hue in the palette, add a "-contrast" color to the map.
33
29
  @each $hue, $color in $base-palette {
34
- $result: map.merge(
35
- $result,
36
- (
37
- "#{$hue}-contrast": map-contrast($base-palette, $hue)
38
- )
39
- );
30
+ $result: map.merge($result,
31
+ ("#{$hue}-contrast": map-contrast($base-palette, $hue)));
40
32
  }
41
33
 
42
34
  @return $result;
@@ -65,13 +57,16 @@
65
57
  grey: $grey,
66
58
  blue-grey: $blue-grey
67
59
  );
68
- @return $palettes;
60
+ @return $palettes;
69
61
  }
70
62
 
71
63
  @function getAllPalettes($theme) {
72
64
  $primary: map.get($theme, primary);
73
65
  $accent: map.get($theme, accent);
66
+ $danger: map.get($theme, danger);
74
67
  $warn: map.get($theme, warn);
68
+ $success: map.get($theme, success);
69
+ $info: map.get($theme, info);
75
70
 
76
71
  // base colors
77
72
  $palettes: (
@@ -98,9 +93,12 @@
98
93
  dark-grey: $dark-grey,
99
94
  primary: $primary,
100
95
  accent: $accent,
101
- warn: $warn
96
+ danger: $danger,
97
+ warn: $warn,
98
+ success: $success,
99
+ info: $info
102
100
  );
103
- @return $palettes;
101
+ @return $palettes;
104
102
  }
105
103
 
106
104
  @function getShade($theme) {
@@ -110,44 +108,50 @@
110
108
  }
111
109
 
112
110
  // Background
113
- @function getBackground($theme){
111
+ @function getBackground($theme) {
114
112
  $background: map.get($theme, background);
115
113
  $background: map.get($background, background);
116
114
  @return $background;
117
115
  }
118
- @function getBackgroundAlpha($theme){
116
+
117
+ @function getBackgroundAlpha($theme) {
119
118
  $background: map.get($theme, background);
120
119
  $background-color: map.get($background, background-alpha);
121
120
  @return $background-color;
122
121
  }
123
- @function getBackgroundInverse($theme){
122
+
123
+ @function getBackgroundInverse($theme) {
124
124
  $background: map.get($theme, background);
125
125
  $background-inverse: map.get($background, background-inverse);
126
126
  @return $background-inverse;
127
127
  }
128
- @function getBackgroundAlphaInverse($theme){
128
+
129
+ @function getBackgroundAlphaInverse($theme) {
129
130
  $background: map.get($theme, background);
130
131
  $background-color: map.get($background, background-alpha-inverse);
131
132
  @return $background-color;
132
133
  }
133
134
 
134
135
  // Surface
135
- @function getSurface($theme){
136
+ @function getSurface($theme) {
136
137
  $background: map.get($theme, background);
137
138
  $surface: map.get($background, card);
138
139
  @return $surface;
139
140
  }
140
- @function getSurfaceAlpha($theme){
141
+
142
+ @function getSurfaceAlpha($theme) {
141
143
  $background: map.get($theme, background);
142
144
  $surface-color: map.get($background, card-alpha);
143
145
  @return $surface-color;
144
146
  }
145
- @function getSurfaceInverse($theme){
147
+
148
+ @function getSurfaceInverse($theme) {
146
149
  $background: map.get($theme, background);
147
150
  $surface-inverse: map.get($background, card-inverse);
148
151
  @return $surface-inverse;
149
152
  }
150
- @function getSurfaceAlphaInverse($theme){
153
+
154
+ @function getSurfaceAlphaInverse($theme) {
151
155
  $background: map.get($theme, background);
152
156
  $surface-color: map.get($background, card-alpha-inverse);
153
157
  @return $surface-color;
@@ -155,38 +159,50 @@
155
159
 
156
160
 
157
161
  // Foreground
158
- @function getForeground($theme){
162
+ @function getForeground($theme) {
159
163
  $is-dark: map.get($theme, is-dark);
164
+
160
165
  @if $is-dark {
161
166
  @return $color-base-blue-grey-100; // Cor clara para tema light
162
- } @else {
167
+ }
168
+
169
+ @else {
163
170
  @return $color-base-blue-grey-900; // Cor escura para tema dark
164
171
  }
165
172
  }
166
173
 
167
- @function getForegroundAlpha($theme){
174
+ @function getForegroundAlpha($theme) {
168
175
  $is-dark: map.get($theme, is-dark);
176
+
169
177
  @if $is-dark {
170
178
  @return rgba($color-base-blue-grey-100, 0.2); // Cor clara para tema light
171
- } @else {
179
+ }
180
+
181
+ @else {
172
182
  @return rgba($color-base-blue-grey-900, 0.2); // Cor escura para tema dark
173
183
  }
174
184
  }
175
185
 
176
- @function getForegroundInverse($theme){
186
+ @function getForegroundInverse($theme) {
177
187
  $is-dark: map.get($theme, is-dark);
188
+
178
189
  @if $is-dark {
179
190
  @return $color-base-blue-grey-900; // Cor clara para tema light
180
- } @else {
191
+ }
192
+
193
+ @else {
181
194
  @return $color-base-blue-grey-100; // Cor escura para tema dark
182
195
  }
183
196
  }
184
197
 
185
- @function getForegroundAlphaInverse($theme){
198
+ @function getForegroundAlphaInverse($theme) {
186
199
  $is-dark: map.get($theme, is-dark);
200
+
187
201
  @if $is-dark {
188
202
  @return rgba($color-base-blue-grey-900, 0.2); // Cor clara para tema light
189
- } @else {
203
+ }
204
+
205
+ @else {
190
206
  @return rgba($color-base-blue-grey-100, 0.2); // Cor escura para tema dark
191
207
  }
192
208
  }
@@ -194,30 +210,34 @@
194
210
 
195
211
  // Disabled
196
212
  // #D4DDE3
197
- @function getDisabled($theme){
213
+ @function getDisabled($theme) {
198
214
  $background: map.get($theme, background);
199
215
  $disabled: map.get($background, disabled);
200
216
  @return $disabled;
201
217
  }
202
- @function getDisabledBgContrast($theme){
218
+
219
+ @function getDisabledBgContrast($theme) {
203
220
  $foreground: map.get($theme, foreground);
204
221
  $disabled-contrast: map.get($foreground, disabled-contrast);
205
222
  @return $disabled-contrast;
206
223
  }
224
+
207
225
  // rgba(0, 0, 0, 0.26),
208
- @function getDisabledContrast($theme){
226
+ @function getDisabledContrast($theme) {
209
227
  $foreground: map.get($theme, foreground);
210
228
  $disabled-contrast: map.get($foreground, disabled);
211
229
  @return $disabled-contrast;
212
230
  }
231
+
213
232
  // #D4DDE3 50%
214
233
  @function getDisabledAlpha($theme) {
215
234
  $background: map.get($theme, background);
216
235
  $disabled-color: map.get($background, disabled-alpha);
217
236
  @return $disabled-color;
218
237
  }
238
+
219
239
  // rgba(0, 0, 0, 0.13)
220
- @function getDisabledContrastAlpha($theme){
240
+ @function getDisabledContrastAlpha($theme) {
221
241
  $foreground: map.get($theme, foreground);
222
242
  $disabled-contrast-alpha: rgba(map.get($foreground, disabled), 0.5);
223
243
  @return $disabled-contrast-alpha;
@@ -231,16 +251,19 @@
231
251
  $red-color: map.get($red, getShade($theme));
232
252
  @return $red-color;
233
253
  }
254
+
234
255
  @function getRedContrast($theme) {
235
256
  $red-contrast-palette: map.get($red, 'contrast');
236
257
  $red-contrast: map.get($red-contrast-palette, getShade($theme));
237
258
  @return $red-contrast;
238
259
  }
260
+
239
261
  @function getRedAlpha($theme) {
240
262
  $red-color: getRed($theme);
241
263
  $red-color-alpha: rgba($red-color, 0.2);
242
264
  @return $red-color-alpha;
243
265
  }
266
+
244
267
  @function getRedContrastAlpha($theme) {
245
268
  $red-contrast: getRedContrast($theme);
246
269
  $red-contrast-alpha: rgba($red-contrast, 0.2);
@@ -252,16 +275,19 @@
252
275
  $pink-color: map.get($pink, getShade($theme));
253
276
  @return $pink-color;
254
277
  }
278
+
255
279
  @function getPinkContrast($theme) {
256
280
  $pink-contrast-palette: map.get($pink, 'contrast');
257
281
  $pink-contrast: map.get($pink-contrast-palette, getShade($theme));
258
282
  @return $pink-contrast;
259
283
  }
284
+
260
285
  @function getPinkAlpha($theme) {
261
286
  $pink-color: getPink($theme);
262
287
  $pink-color-alpha: rgba($pink-color, 0.2);
263
288
  @return $pink-color-alpha;
264
289
  }
290
+
265
291
  @function getPinkContrastAlpha($theme) {
266
292
  $pink-contrast: getPinkContrast($theme);
267
293
  $pink-contrast-alpha: rgba($pink-contrast, 0.2);
@@ -273,16 +299,19 @@
273
299
  $purple-color: map.get($purple, getShade($theme));
274
300
  @return $purple-color;
275
301
  }
302
+
276
303
  @function getPurpleContrast($theme) {
277
304
  $purple-contrast-palette: map.get($purple, 'contrast');
278
305
  $purple-contrast: map.get($purple-contrast-palette, getShade($theme));
279
306
  @return $purple-contrast;
280
307
  }
308
+
281
309
  @function getPurpleAlpha($theme) {
282
310
  $purple-color: getPurple($theme);
283
311
  $purple-color-alpha: rgba($purple-color, 0.2);
284
312
  @return $purple-color-alpha;
285
313
  }
314
+
286
315
  @function getPurpleContrastAlpha($theme) {
287
316
  $purple-contrast: getPurpleContrast($theme);
288
317
  $purple-contrast-alpha: rgba($purple-contrast, 0.2);
@@ -294,16 +323,19 @@
294
323
  $deep-purple-color: map.get($deep-purple, getShade($theme));
295
324
  @return $deep-purple-color;
296
325
  }
326
+
297
327
  @function getDeepPurpleContrast($theme) {
298
328
  $deep-purple-contrast-palette: map.get($deep-purple, 'contrast');
299
329
  $deep-purple-contrast: map.get($deep-purple-contrast-palette, getShade($theme));
300
330
  @return $deep-purple-contrast;
301
331
  }
332
+
302
333
  @function getDeepPurpleAlpha($theme) {
303
334
  $deep-purple-color: getDeepPurple($theme);
304
335
  $deep-purple-color-alpha: rgba($deep-purple-color, 0.2);
305
336
  @return $deep-purple-color-alpha;
306
337
  }
338
+
307
339
  @function getDeepPurpleContrastAlpha($theme) {
308
340
  $deep-purple-contrast: getDeepPurpleContrast($theme);
309
341
  $deep-purple-contrast-alpha: rgba($deep-purple-contrast, 0.2);
@@ -315,16 +347,19 @@
315
347
  $indigo-color: map.get($indigo, getShade($theme));
316
348
  @return $indigo-color;
317
349
  }
350
+
318
351
  @function getIndigoContrast($theme) {
319
352
  $indigo-contrast-palette: map.get($indigo, 'contrast');
320
353
  $indigo-contrast: map.get($indigo-contrast-palette, getShade($theme));
321
354
  @return $indigo-contrast;
322
355
  }
356
+
323
357
  @function getIndigoAlpha($theme) {
324
358
  $indigo-color: getIndigo($theme);
325
359
  $indigo-color-alpha: rgba($indigo-color, 0.2);
326
360
  @return $indigo-color-alpha;
327
361
  }
362
+
328
363
  @function getIndigoContrastAlpha($theme) {
329
364
  $indigo-contrast: getIndigoContrast($theme);
330
365
  $indigo-contrast-alpha: rgba($indigo-contrast, 0.2);
@@ -336,16 +371,19 @@
336
371
  $blue-color: map.get($blue, getShade($theme));
337
372
  @return $blue-color;
338
373
  }
374
+
339
375
  @function getBlueContrast($theme) {
340
376
  $blue-contrast-palette: map.get($blue, 'contrast');
341
377
  $blue-contrast: map.get($blue-contrast-palette, getShade($theme));
342
378
  @return $blue-contrast;
343
379
  }
380
+
344
381
  @function getBlueAlpha($theme) {
345
382
  $blue-color: getBlue($theme);
346
383
  $blue-color-alpha: rgba($blue-color, 0.2);
347
384
  @return $blue-color-alpha;
348
385
  }
386
+
349
387
  @function getBlueContrastAlpha($theme) {
350
388
  $blue-contrast: getBlueContrast($theme);
351
389
  $blue-contrast-alpha: rgba($blue-contrast, 0.2);
@@ -357,16 +395,19 @@
357
395
  $light-blue-color: map.get($light-blue, getShade($theme));
358
396
  @return $light-blue-color;
359
397
  }
398
+
360
399
  @function getLightBlueContrast($theme) {
361
400
  $light-blue-contrast-palette: map.get($light-blue, 'contrast');
362
401
  $light-blue-contrast: map.get($light-blue-contrast-palette, getShade($theme));
363
402
  @return $light-blue-contrast;
364
403
  }
404
+
365
405
  @function getLightBlueAlpha($theme) {
366
406
  $light-blue-color: getLightBlue($theme);
367
407
  $light-blue-color-alpha: rgba($light-blue-color, 0.2);
368
408
  @return $light-blue-color-alpha;
369
409
  }
410
+
370
411
  @function getLightBlueContrastAlpha($theme) {
371
412
  $light-blue-contrast: getLightBlueContrast($theme);
372
413
  $light-blue-contrast-alpha: rgba($light-blue-contrast, 0.2);
@@ -378,16 +419,19 @@
378
419
  $cyan-color: map.get($cyan, getShade($theme));
379
420
  @return $cyan-color;
380
421
  }
422
+
381
423
  @function getCyanContrast($theme) {
382
424
  $cyan-contrast-palette: map.get($cyan, 'contrast');
383
425
  $cyan-contrast: map.get($cyan-contrast-palette, getShade($theme));
384
426
  @return $cyan-contrast;
385
427
  }
428
+
386
429
  @function getCyanAlpha($theme) {
387
430
  $cyan-color: getCyan($theme);
388
431
  $cyan-color-alpha: rgba($cyan-color, 0.2);
389
432
  @return $cyan-color-alpha;
390
433
  }
434
+
391
435
  @function getCyanContrastAlpha($theme) {
392
436
  $cyan-contrast: getCyanContrast($theme);
393
437
  $cyan-contrast-alpha: rgba($cyan-contrast, 0.2);
@@ -399,16 +443,19 @@
399
443
  $teal-color: map.get($teal, getShade($theme));
400
444
  @return $teal-color;
401
445
  }
446
+
402
447
  @function getTealContrast($theme) {
403
448
  $teal-contrast-palette: map.get($teal, 'contrast');
404
449
  $teal-contrast: map.get($teal-contrast-palette, getShade($theme));
405
450
  @return $teal-contrast;
406
451
  }
452
+
407
453
  @function getTealAlpha($theme) {
408
454
  $teal-color: getTeal($theme);
409
455
  $teal-color-alpha: rgba($teal-color, 0.2);
410
456
  @return $teal-color-alpha;
411
457
  }
458
+
412
459
  @function getTealContrastAlpha($theme) {
413
460
  $teal-contrast: getTealContrast($theme);
414
461
  $teal-contrast-alpha: rgba($teal-contrast, 0.2);
@@ -420,16 +467,19 @@
420
467
  $green-color: map.get($green, getShade($theme));
421
468
  @return $green-color;
422
469
  }
470
+
423
471
  @function getGreenContrast($theme) {
424
472
  $green-contrast-palette: map.get($green, 'contrast');
425
473
  $green-contrast: map.get($green-contrast-palette, getShade($theme));
426
474
  @return $green-contrast;
427
475
  }
476
+
428
477
  @function getGreenAlpha($theme) {
429
478
  $green-color: getGreen($theme);
430
479
  $green-color-alpha: rgba($green-color, 0.2);
431
480
  @return $green-color-alpha;
432
481
  }
482
+
433
483
  @function getGreenContrastAlpha($theme) {
434
484
  $green-contrast: getGreenContrast($theme);
435
485
  $green-contrast-alpha: rgba($green-contrast, 0.2);
@@ -441,16 +491,19 @@
441
491
  $light-green-color: map.get($light-green, getShade($theme));
442
492
  @return $light-green-color;
443
493
  }
494
+
444
495
  @function getLightGreenContrast($theme) {
445
496
  $light-green-contrast-palette: map.get($light-green, 'contrast');
446
497
  $light-green-contrast: map.get($light-green-contrast-palette, getShade($theme));
447
498
  @return $light-green-contrast;
448
499
  }
500
+
449
501
  @function getLightGreenAlpha($theme) {
450
502
  $light-green-color: getLightGreen($theme);
451
503
  $light-green-color-alpha: rgba($light-green-color, 0.2);
452
504
  @return $light-green-color-alpha;
453
505
  }
506
+
454
507
  @function getLightGreenContrastAlpha($theme) {
455
508
  $light-green-contrast: getLightGreenContrast($theme);
456
509
  $light-green-contrast-alpha: rgba($light-green-contrast, 0.2);
@@ -462,16 +515,19 @@
462
515
  $lime-color: map.get($lime, getShade($theme));
463
516
  @return $lime-color;
464
517
  }
518
+
465
519
  @function getLimeContrast($theme) {
466
520
  $lime-contrast-palette: map.get($lime, 'contrast');
467
521
  $lime-contrast: map.get($lime-contrast-palette, getShade($theme));
468
522
  @return $lime-contrast;
469
523
  }
524
+
470
525
  @function getLimeAlpha($theme) {
471
526
  $lime-color: getLime($theme);
472
527
  $lime-color-alpha: rgba($lime-color, 0.2);
473
528
  @return $lime-color-alpha;
474
529
  }
530
+
475
531
  @function getLimeContrastAlpha($theme) {
476
532
  $lime-contrast: getLimeContrast($theme);
477
533
  $lime-contrast-alpha: rgba($lime-contrast, 0.2);
@@ -483,16 +539,19 @@
483
539
  $yellow-color: map.get($yellow, getShade($theme));
484
540
  @return $yellow-color;
485
541
  }
542
+
486
543
  @function getYellowContrast($theme) {
487
544
  $yellow-contrast-palette: map.get($yellow, 'contrast');
488
545
  $yellow-contrast: map.get($yellow-contrast-palette, getShade($theme));
489
546
  @return $yellow-contrast;
490
547
  }
548
+
491
549
  @function getYellowAlpha($theme) {
492
550
  $yellow-color: getYellow($theme);
493
551
  $yellow-color-alpha: rgba($yellow-color, 0.2);
494
552
  @return $yellow-color-alpha;
495
553
  }
554
+
496
555
  @function getYellowContrastAlpha($theme) {
497
556
  $yellow-contrast: getYellowContrast($theme);
498
557
  $yellow-contrast-alpha: rgba($yellow-contrast, 0.2);
@@ -504,16 +563,19 @@
504
563
  $amber-color: map.get($amber, getShade($theme));
505
564
  @return $amber-color;
506
565
  }
566
+
507
567
  @function getAmberContrast($theme) {
508
568
  $amber-contrast-palette: map.get($amber, 'contrast');
509
569
  $amber-contrast: map.get($amber-contrast-palette, getShade($theme));
510
570
  @return $amber-contrast;
511
571
  }
572
+
512
573
  @function getAmberAlpha($theme) {
513
574
  $amber-color: getAmber($theme);
514
575
  $amber-color-alpha: rgba($amber-color, 0.2);
515
576
  @return $amber-color-alpha;
516
577
  }
578
+
517
579
  @function getAmberContrastAlpha($theme) {
518
580
  $amber-contrast: getAmberContrast($theme);
519
581
  $amber-contrast-alpha: rgba($amber-contrast, 0.2);
@@ -525,16 +587,19 @@
525
587
  $orange-color: map.get($orange, getShade($theme));
526
588
  @return $orange-color;
527
589
  }
590
+
528
591
  @function getOrangeContrast($theme) {
529
592
  $orange-contrast-palette: map.get($orange, 'contrast');
530
593
  $orange-contrast: map.get($orange-contrast-palette, getShade($theme));
531
594
  @return $orange-contrast;
532
595
  }
596
+
533
597
  @function getOrangeAlpha($theme) {
534
598
  $orange-color: getOrange($theme);
535
599
  $orange-color-alpha: rgba($orange-color, 0.2);
536
600
  @return $orange-color-alpha;
537
601
  }
602
+
538
603
  @function getOrangeContrastAlpha($theme) {
539
604
  $orange-contrast: getOrangeContrast($theme);
540
605
  $orange-contrast-alpha: rgba($orange-contrast, 0.2);
@@ -546,16 +611,19 @@
546
611
  $deep-orange-color: map.get($deep-orange, getShade($theme));
547
612
  @return $deep-orange-color;
548
613
  }
614
+
549
615
  @function getDeepOrangeContrast($theme) {
550
616
  $deep-orange-contrast-palette: map.get($deep-orange, 'contrast');
551
617
  $deep-orange-contrast: map.get($deep-orange-contrast-palette, getShade($theme));
552
618
  @return $deep-orange-contrast;
553
619
  }
620
+
554
621
  @function getDeepOrangeAlpha($theme) {
555
622
  $deep-orange-color: getDeepOrange($theme);
556
623
  $deep-orange-color-alpha: rgba($deep-orange-color, 0.2);
557
624
  @return $deep-orange-color-alpha;
558
625
  }
626
+
559
627
  @function getDeepOrangeContrastAlpha($theme) {
560
628
  $deep-orange-contrast: getDeepOrangeContrast($theme);
561
629
  $deep-orange-contrast-alpha: rgba($deep-orange-contrast, 0.2);
@@ -567,16 +635,19 @@
567
635
  $brown-color: map.get($brown, getShade($theme));
568
636
  @return $brown-color;
569
637
  }
638
+
570
639
  @function getBrownContrast($theme) {
571
640
  $brown-contrast-palette: map.get($brown, 'contrast');
572
641
  $brown-contrast: map.get($brown-contrast-palette, getShade($theme));
573
642
  @return $brown-contrast;
574
643
  }
644
+
575
645
  @function getBrownAlpha($theme) {
576
646
  $brown-color: getBrown($theme);
577
647
  $brown-color-alpha: rgba($brown-color, 0.2);
578
648
  @return $brown-color-alpha;
579
649
  }
650
+
580
651
  @function getBrownContrastAlpha($theme) {
581
652
  $brown-contrast: getBrownContrast($theme);
582
653
  $brown-contrast-alpha: rgba($brown-contrast, 0.2);
@@ -588,16 +659,19 @@
588
659
  $grey-color: map.get($grey, getShade($theme));
589
660
  @return $grey-color;
590
661
  }
662
+
591
663
  @function getGreyContrast($theme) {
592
664
  $grey-contrast-palette: map.get($grey, 'contrast');
593
665
  $grey-contrast: map.get($grey-contrast-palette, getShade($theme));
594
666
  @return $grey-contrast;
595
667
  }
668
+
596
669
  @function getGreyAlpha($theme) {
597
670
  $grey-color: getGrey($theme);
598
671
  $grey-color-alpha: rgba($grey-color, 0.2);
599
672
  @return $grey-color-alpha;
600
673
  }
674
+
601
675
  @function getGreyContrastAlpha($theme) {
602
676
  $grey-contrast: getGreyContrast($theme);
603
677
  $grey-contrast-alpha: rgba($grey-contrast, 0.2);
@@ -609,16 +683,19 @@
609
683
  $blue-grey-color: map.get($blue-grey, getShade($theme));
610
684
  @return $blue-grey-color;
611
685
  }
686
+
612
687
  @function getBlueGreyContrast($theme) {
613
688
  $blue-grey-contrast-palette: map.get($blue-grey, 'contrast');
614
689
  $blue-grey-contrast: map.get($blue-grey-contrast-palette, getShade($theme));
615
690
  @return $blue-grey-contrast;
616
691
  }
692
+
617
693
  @function getBlueGreyAlpha($theme) {
618
694
  $blue-grey-color: getBlueGrey($theme);
619
695
  $blue-grey-color-alpha: rgba($blue-grey-color, 0.2);
620
696
  @return $blue-grey-color-alpha;
621
697
  }
698
+
622
699
  @function getBlueGreyContrastAlpha($theme) {
623
700
  $blue-grey-contrast: getBlueGreyContrast($theme);
624
701
  $blue-grey-contrast-alpha: rgba($blue-grey-contrast, 0.2);
@@ -631,16 +708,19 @@
631
708
  $primary-color: map.get($primary, default);
632
709
  @return $primary-color;
633
710
  }
711
+
634
712
  @function getPrimaryContrast($theme) {
635
713
  $primary: map.get($theme, primary);
636
714
  $primary-contrast: map.get($primary, default-contrast);
637
715
  @return $primary-contrast;
638
716
  }
717
+
639
718
  @function getPrimaryAlpha($theme) {
640
719
  $primary-color: getPrimary($theme);
641
720
  $primary-color-alpha: rgba($primary-color, 0.2);
642
721
  @return $primary-color-alpha;
643
722
  }
723
+
644
724
  @function getPrimaryContrastAlpha($theme) {
645
725
  $primary-contrast: getPrimaryContrast($theme);
646
726
  $primary-contrast-alpha: rgba($primary-contrast, 0.2);
@@ -653,46 +733,124 @@
653
733
  $accent-color: map.get($accent, default);
654
734
  @return $accent-color;
655
735
  }
736
+
656
737
  @function getAccentContrast($theme) {
657
738
  $accent: map.get($theme, accent);
658
739
  $accent-contrast: map.get($accent, default-contrast);
659
740
  @return $accent-contrast;
660
741
  }
742
+
661
743
  @function getAccentAlpha($theme) {
662
744
  $accent-color: getAccent($theme);
663
745
  $accent-color-alpha: rgba($accent-color, 0.2);
664
746
  @return $accent-color-alpha;
665
747
  }
748
+
666
749
  @function getAccentContrastAlpha($theme) {
667
750
  $accent-contrast: getAccentContrast($theme);
668
751
  $accent-contrast-alpha: rgba($accent-contrast, 0.2);
669
752
  @return $accent-contrast-alpha;
670
753
  }
671
754
 
755
+ // Danger
756
+ @function getDanger($theme) {
757
+ $danger: map.get($theme, danger);
758
+ $danger-color: map.get($danger, default);
759
+ @return $danger-color;
760
+ }
761
+
762
+ @function getDangerContrast($theme) {
763
+ $danger: map.get($theme, danger);
764
+ $danger-contrast: map.get($danger, default-contrast);
765
+ @return $danger-contrast;
766
+ }
767
+
768
+ @function getDangerAlpha($theme) {
769
+ $danger-color: getDanger($theme);
770
+ $danger-color-alpha: rgba($danger-color, 0.2);
771
+ @return $danger-color-alpha;
772
+ }
773
+
774
+ @function getDangerContrastAlpha($theme) {
775
+ $danger-contrast: getDangerContrast($theme);
776
+ $danger-contrast-alpha: rgba($danger-contrast, 0.2);
777
+ @return $danger-contrast-alpha;
778
+ }
779
+
672
780
  // Warn
673
781
  @function getWarn($theme) {
674
782
  $warn: map.get($theme, warn);
675
783
  $warn-color: map.get($warn, default);
676
784
  @return $warn-color;
677
785
  }
786
+
678
787
  @function getWarnContrast($theme) {
679
788
  $warn: map.get($theme, warn);
680
789
  $warn-contrast: map.get($warn, default-contrast);
681
790
  @return $warn-contrast;
682
791
  }
792
+
683
793
  @function getWarnAlpha($theme) {
684
794
  $warn-color: getWarn($theme);
685
795
  $warn-color-alpha: rgba($warn-color, 0.2);
686
796
  @return $warn-color-alpha;
687
797
  }
798
+
688
799
  @function getWarnContrastAlpha($theme) {
689
800
  $warn-contrast: getWarnContrast($theme);
690
801
  $warn-contrast-alpha: rgba($warn-contrast, 0.2);
691
802
  @return $warn-contrast-alpha;
692
803
  }
693
804
 
805
+ // Success
806
+ @function getSuccess($theme) {
807
+ $success: map.get($theme, success);
808
+ $success-color: map.get($success, default);
809
+ @return $success-color;
810
+ }
811
+
812
+ @function getSuccessContrast($theme) {
813
+ $success: map.get($theme, success);
814
+ $success-contrast: map.get($success, default-contrast);
815
+ @return $success-contrast;
816
+ }
817
+
818
+ @function getSuccessAlpha($theme) {
819
+ $success-color: getSuccess($theme);
820
+ $success-color-alpha: rgba($success-color, 0.2);
821
+ @return $success-color-alpha;
822
+ }
823
+
824
+ @function getSuccessContrastAlpha($theme) {
825
+ $success-contrast: getSuccessContrast($theme);
826
+ $success-contrast-alpha: rgba($success-contrast, 0.2);
827
+ @return $success-contrast-alpha;
828
+ }
829
+
830
+ // Info
831
+ @function getInfo($theme) {
832
+ $info: map.get($theme, info);
833
+ $info-color: map.get($info, default);
834
+ @return $info-color;
835
+ }
836
+
837
+ @function getInfoContrast($theme) {
838
+ $info: map.get($theme, info);
839
+ $info-contrast: map.get($info, default-contrast);
840
+ @return $info-contrast;
841
+ }
694
842
 
843
+ @function getInfoAlpha($theme) {
844
+ $info-color: getInfo($theme);
845
+ $info-color-alpha: rgba($info-color, 0.2);
846
+ @return $info-color-alpha;
847
+ }
695
848
 
849
+ @function getInfoContrastAlpha($theme) {
850
+ $info-contrast: getInfoContrast($theme);
851
+ $info-contrast-alpha: rgba($info-contrast, 0.2);
852
+ @return $info-contrast-alpha;
853
+ }
696
854
 
697
855
 
698
856
  // Gets a color from a theme palette (the output of mat-palette).
@@ -704,9 +862,10 @@
704
862
  // be treated as opacity.
705
863
  // @param $opacity The alpha channel value for the color.
706
864
  @function map-color($palette, $hue: default, $opacity: null) {
865
+
707
866
  // If hueKey is a number between zero and one, then it actually contains an
708
867
  // opacity value, so recall this function with the default hue and that given opacity.
709
- @if type-of($hue) ==number and $hue >=0 and $hue <=1 {
868
+ @if type-of($hue)==number and $hue >=0 and $hue <=1 {
710
869
  @return map-color($palette, default, $hue);
711
870
  }
712
871
 
@@ -723,79 +882,100 @@
723
882
  }
724
883
 
725
884
  // Creates a container object for a light theme to be given to individual component theme mixins.
726
- @function light-theme($primary, $accent, $warn) {
727
- @return (
728
- primary: $primary,
885
+ @function light-theme($primary,
886
+ $accent,
887
+ $warn: palette($yellow, 600),
888
+ $danger: palette($red, A700),
889
+ $success: palette($green, 900),
890
+ $info: palette($blue, 900)) {
891
+ @return (primary: $primary,
729
892
  accent: $accent,
730
893
  warn: $warn,
894
+ danger: $danger,
895
+ success: $success,
896
+ info: $info,
731
897
  is-dark: false,
732
898
  foreground: $light-theme-foreground-palette,
733
- background: $light-theme-background-palette
734
- );
899
+ background: $light-theme-background-palette );
735
900
  }
736
901
 
737
902
  // Creates a container object for a dark theme to be given to individual component theme mixins.
738
- @function dark-theme($primary, $accent, $warn) {
739
- @return (
740
- primary: $primary,
903
+ @function dark-theme($primary, $accent, $warn: palette($yellow, 200),
904
+ $danger: palette($red, 200),
905
+ $success: palette($green, 200),
906
+ $info: palette($blue, 200)) {
907
+ @return (primary: $primary,
741
908
  accent: $accent,
742
909
  warn: $warn,
910
+ danger: $danger,
911
+ success: $success,
912
+ info: $info,
743
913
  is-dark: true,
744
914
  foreground: $dark-theme-foreground-palette,
745
- background: $dark-theme-background-palette
746
- );
915
+ background: $dark-theme-background-palette );
747
916
  }
748
917
 
749
918
  // Creates a container object for a custom light theme to be given to individual component theme mixins.
750
- @function light-custom-theme($primary, $accent, $warn, $custom-light-fg, $custom-light-bg) {
751
- @return (
752
- primary: $primary,
919
+ @function light-custom-theme($custom-light-fg,
920
+ $custom-light-bg,
921
+ $primary,
922
+ $accent,
923
+ $warn: palette($yellow, 600),
924
+ $danger: palette($red, A700),
925
+ $success: palette($green, 900),
926
+ $info: palette($blue, 900)) {
927
+ @return (primary: $primary,
753
928
  accent: $accent,
754
929
  warn: $warn,
930
+ danger: $danger,
931
+ success: $success,
932
+ info: $info,
755
933
  is-dark: false,
756
934
  foreground: $custom-light-fg,
757
- background: $custom-light-bg
758
- );
935
+ background: $custom-light-bg );
759
936
  }
760
937
 
761
938
  // Creates a container object for a custom dark theme to be given to individual component theme mixins.
762
- @function dark-custom-theme($primary, $accent, $warn, $custom-dark-fg, $custom-dark-bg) {
763
- @return (
764
- primary: $primary,
939
+ @function dark-custom-theme($custom-dark-fg,
940
+ $custom-dark-bg,
941
+ $primary,
942
+ $accent,
943
+ $warn: palette($yellow, 200),
944
+ $danger: palette($red, 200),
945
+ $success: palette($green, 200),
946
+ $info: palette($blue, 200)) {
947
+ @return (primary: $primary,
765
948
  accent: $accent,
766
949
  warn: $warn,
950
+ danger: $danger,
951
+ success: $success,
952
+ info: $info,
767
953
  is-dark: true,
768
954
  foreground: $custom-dark-fg,
769
- background: $custom-dark-bg
770
- );
955
+ background: $custom-dark-bg );
771
956
  }
772
957
 
773
958
  // -------------------------------------------------------------------------------------------------------------------
774
959
  // @ Typography functions
775
960
  // --------------------------------------------------------------------------------------------------------------------
776
961
  // Represents a typography level from the Material design spec.
777
- @function matcha-typography-level(
778
- $font-size,
962
+ @function matcha-typography-level($font-size,
779
963
  $line-height: $font-size,
780
964
  $font-weight: 400,
781
965
  $font-family: null,
782
- $letter-spacing: null
783
- ) {
784
- @return (
785
- font-size: $font-size,
966
+ $letter-spacing: null) {
967
+ @return (font-size: $font-size,
786
968
  line-height: $line-height,
787
969
  font-weight: $font-weight,
788
970
  font-family: $font-family,
789
- letter-spacing: $letter-spacing
790
- );
971
+ letter-spacing: $letter-spacing );
791
972
  }
792
973
 
793
974
  // Represents a collection of typography levels.
794
975
  // Defaults come from https://material.io/guidelines/style/typography.html
795
976
  // Note: The spec doesn't mention letter spacing. The values here come from
796
977
  // eyeballing it until it looked exactly like the spec examples.
797
- @function matcha-typography-config(
798
- $font-family: 'CircularStd, "Helvetica Neue", "Arial", sans-serif, "angular";',
978
+ @function matcha-typography-config($font-family: 'CircularStd, "Helvetica Neue", "Arial", sans-serif, "angular";',
799
979
  $display-4: matcha-typography-level(112px, 112px, 300, $letter-spacing: -0.05em),
800
980
  $display-3: matcha-typography-level(56px, 56px, 400, $letter-spacing: -0.02em),
801
981
  $display-2: matcha-typography-level(45px, 48px, 400, $letter-spacing: -0.005em),
@@ -808,8 +988,7 @@
808
988
  $body-1: matcha-typography-level(14px, 20px, 400),
809
989
  $caption: matcha-typography-level(12px, 20px, 500),
810
990
  $button: matcha-typography-level(14px, 14px, 500),
811
- $input: matcha-typography-level(inherit, 1.125, 400)
812
- ) {
991
+ $input: matcha-typography-level(inherit, 1.125, 400)) {
813
992
  // Line-height must be unit-less fraction of the font-size.
814
993
  // Declare an initial map with all of the levels.
815
994
  $config: (
@@ -828,32 +1007,20 @@
828
1007
  input: $input
829
1008
  );
830
1009
 
831
- // Loop through the levels and set the `font-family` of the ones that don't have one to the base.
832
- // Note that Sass can't modify maps in place, which means that we need to merge and re-assign.
833
- @each $key, $level in $config {
834
- @if map.get($level, font-family) == null {
835
- $new-level: map.merge(
836
- $level,
837
- (
838
- font-family: $font-family
839
- )
840
- );
841
- $config: map.merge(
842
- $config,
843
- (
844
- $key: $new-level
845
- )
846
- );
847
- }
1010
+ // Loop through the levels and set the `font-family` of the ones that don't have one to the base.
1011
+ // Note that Sass can't modify maps in place, which means that we need to merge and re-assign.
1012
+ @each $key, $level in $config {
1013
+ @if map.get($level, font-family)==null {
1014
+ $new-level: map.merge($level,
1015
+ (font-family: $font-family ));
1016
+ $config: map.merge($config,
1017
+ ($key: $new-level ));
848
1018
  }
1019
+ }
849
1020
 
850
- // Add the base font family to the config.
851
- @return map.merge(
852
- $config,
853
- (
854
- font-family: $font-family
855
- )
856
- );
1021
+ // Add the base font family to the config.
1022
+ @return map.merge($config,
1023
+ (font-family: $font-family ));
857
1024
  }
858
1025
 
859
1026
  // Utility for fetching a nested value from a typography config.
@@ -890,7 +1057,7 @@
890
1057
  }
891
1058
 
892
1059
  // Guard against unquoting non-string values, because it's deprecated.
893
- @return if(type-of($font-family) ==string, unquote($font-family), $font-family);
1060
+ @return if(type-of($font-family)==string, unquote($font-family), $font-family);
894
1061
  }
895
1062
 
896
1063
  // -------------------------------------------------------------------------------------------------------------------
@@ -899,10 +1066,9 @@
899
1066
  // A collection of functions that can be used to apply elevation to a material
900
1067
 
901
1068
  @function _get-umbra-map($color, $opacity) {
902
- $shadow-color: if(type-of($color) ==color, rgba($color, $opacity * 0.033), $color);
1069
+ $shadow-color: if(type-of($color)==color, rgba($color, $opacity * 0.033), $color);
903
1070
 
904
- @return (
905
- 0: "0px 0px 0px 0px #{$shadow-color}",
1071
+ @return (0: "0px 0px 0px 0px #{$shadow-color}",
906
1072
  1: "0px 2px 2px 0px #{$shadow-color}",
907
1073
  2: "0px 3px 2px -2px #{$shadow-color}",
908
1074
  3: "0px 3px 3px -2px #{$shadow-color}",
@@ -931,10 +1097,9 @@
931
1097
  }
932
1098
 
933
1099
  @function _get-penumbra-map($color, $opacity) {
934
- $shadow-color: if(type-of($color) ==color, rgba($color, $opacity * 0.033), $color);
1100
+ $shadow-color: if(type-of($color)==color, rgba($color, $opacity * 0.033), $color);
935
1101
 
936
- @return (
937
- 0: "0px 0px 0px 0px #{$shadow-color}",
1102
+ @return (0: "0px 0px 0px 0px #{$shadow-color}",
938
1103
  1: "0px 2px 2px 0px #{$shadow-color}",
939
1104
  2: "0px 2px 3px 0px #{$shadow-color}",
940
1105
  3: "0px 3px 4px 0px #{$shadow-color}",
@@ -963,10 +1128,9 @@
963
1128
  }
964
1129
 
965
1130
  @function _get-ambient-map($color, $opacity) {
966
- $shadow-color: if(type-of($color) ==color, rgba($color, $opacity * 0.033), $color);
1131
+ $shadow-color: if(type-of($color)==color, rgba($color, $opacity * 0.033), $color);
967
1132
 
968
- @return (
969
- 0: "0px 0px 0px 0px #{$shadow-color}",
1133
+ @return (0: "0px 0px 0px 0px #{$shadow-color}",
970
1134
  1: "0px 2px 2px 0px #{$shadow-color}",
971
1135
  2: "0px 1px 5px 0px #{$shadow-color}",
972
1136
  3: "0px 1px 8px 0px #{$shadow-color}",
@@ -1001,10 +1165,8 @@
1001
1165
  // .foo {
1002
1166
  // transition: elevation-transition-property-value(), opacity 100ms ease;
1003
1167
  // }
1004
- @function elevation-transition-property-value(
1005
- $duration: $elevation-transition-duration,
1006
- $easing: $elevation-transition-timing-function
1007
- ) {
1168
+ @function elevation-transition-property-value($duration: $elevation-transition-duration,
1169
+ $easing: $elevation-transition-timing-function) {
1008
1170
  @return box-shadow #{$duration} #{$easing};
1009
1171
  }
1010
1172
 
@@ -1013,9 +1175,11 @@ $base-font-size: 16px;
1013
1175
 
1014
1176
  // Function to convert pixels to rem.
1015
1177
  @function px-to-rem($value-in-px) {
1016
- @if $value-in-px != 0 {
1178
+ @if $value-in-px !=0 {
1017
1179
  @return calc($value-in-px / $base-font-size) * 1rem;
1018
- } @else {
1180
+ }
1181
+
1182
+ @else {
1019
1183
  @return $value-in-px;
1020
1184
  }
1021
- }
1185
+ }