matcha-theme 19.56.0 → 19.57.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.
- package/abstracts/_colors.scss +47 -420
- package/abstracts/_functions.scss +135 -129
- package/components/matcha-cards.scss +67 -437
- package/components/matcha-modal.scss +86 -0
- package/components/matcha-table.scss +4 -4
- package/main.scss +2 -3
- package/package.json +1 -1
- package/tokens/_color-tokens.scss +92 -133
- package/components/matcha-slide-toggle.scss +0 -398
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@use "sass:color";
|
|
3
|
+
|
|
1
4
|
// -------------------------------------------------------------------------------------------------------------------
|
|
2
5
|
// @ Theme functions
|
|
3
6
|
// --------------------------------------------------------------------------------------------------------------------
|
|
@@ -5,7 +8,7 @@
|
|
|
5
8
|
// @param $color-map
|
|
6
9
|
// @param $hue
|
|
7
10
|
@function map-contrast($palette, $hue) {
|
|
8
|
-
@return map
|
|
11
|
+
@return map.get(map.get($palette, contrast), $hue);
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
// Creates a map of hues to colors for a theme. This is used to define a theme palette in terms
|
|
@@ -14,12 +17,12 @@
|
|
|
14
17
|
// @param $primary
|
|
15
18
|
// @param $lighter
|
|
16
19
|
@function palette($base-palette, $default: 500, $lighter: 100, $darker: 700) {
|
|
17
|
-
$result:
|
|
20
|
+
$result: map.merge(
|
|
18
21
|
$base-palette,
|
|
19
22
|
(
|
|
20
|
-
default: map
|
|
21
|
-
lighter: map
|
|
22
|
-
darker: map
|
|
23
|
+
default: map.get($base-palette, $default),
|
|
24
|
+
lighter: map.get($base-palette, $lighter),
|
|
25
|
+
darker: map.get($base-palette, $darker),
|
|
23
26
|
default-contrast: map-contrast($base-palette, $default),
|
|
24
27
|
lighter-contrast: map-contrast($base-palette, $lighter),
|
|
25
28
|
darker-contrast: map-contrast($base-palette, $darker)
|
|
@@ -28,7 +31,7 @@
|
|
|
28
31
|
|
|
29
32
|
// For each hue in the palette, add a "-contrast" color to the map.
|
|
30
33
|
@each $hue, $color in $base-palette {
|
|
31
|
-
$result:
|
|
34
|
+
$result: map.merge(
|
|
32
35
|
$result,
|
|
33
36
|
(
|
|
34
37
|
"#{$hue}-contrast": map-contrast($base-palette, $hue)
|
|
@@ -66,9 +69,9 @@
|
|
|
66
69
|
}
|
|
67
70
|
|
|
68
71
|
@function getAllPalettes($theme) {
|
|
69
|
-
$primary: map
|
|
70
|
-
$accent: map
|
|
71
|
-
$warn: map
|
|
72
|
+
$primary: map.get($theme, primary);
|
|
73
|
+
$accent: map.get($theme, accent);
|
|
74
|
+
$warn: map.get($theme, warn);
|
|
72
75
|
|
|
73
76
|
// base colors
|
|
74
77
|
$palettes: (
|
|
@@ -99,106 +102,109 @@
|
|
|
99
102
|
}
|
|
100
103
|
|
|
101
104
|
@function getShade($theme) {
|
|
102
|
-
$is-dark: map
|
|
105
|
+
$is-dark: map.get($theme, is-dark);
|
|
103
106
|
$get-shade: if($is-dark, 100, 500); // Define $red-shade com base no valor de $is-dark
|
|
104
107
|
@return $get-shade;
|
|
105
108
|
}
|
|
106
109
|
|
|
107
110
|
// Background
|
|
108
111
|
@function getBackground($theme){
|
|
109
|
-
$background: map
|
|
110
|
-
$background: map
|
|
112
|
+
$background: map.get($theme, background);
|
|
113
|
+
$background: map.get($background, background);
|
|
111
114
|
@return $background;
|
|
112
115
|
}
|
|
113
116
|
@function getBackgroundAlpha($theme){
|
|
114
|
-
$background: map
|
|
115
|
-
$background-
|
|
116
|
-
@return $background-alpha;
|
|
117
|
+
$background: map.get($theme, background);
|
|
118
|
+
$background-color: map.get($background, background);
|
|
119
|
+
@return color.change($background-color, $alpha: 0.5);
|
|
117
120
|
}
|
|
118
121
|
@function getBackgroundInverse($theme){
|
|
119
|
-
$background: map
|
|
120
|
-
$background-inverse: map
|
|
122
|
+
$background: map.get($theme, background);
|
|
123
|
+
$background-inverse: map.get($background, background-inverse);
|
|
121
124
|
@return $background-inverse;
|
|
122
125
|
}
|
|
123
126
|
@function getBackgroundAlphaInverse($theme){
|
|
124
|
-
$background: map
|
|
125
|
-
$background-
|
|
126
|
-
@return $background-alpha
|
|
127
|
+
$background: map.get($theme, background);
|
|
128
|
+
$background-color: map.get($background, background-inverse);
|
|
129
|
+
@return color.change($background-color, $alpha: 0.5);
|
|
127
130
|
}
|
|
128
131
|
|
|
129
132
|
// Surface
|
|
130
133
|
@function getSurface($theme){
|
|
131
|
-
$background: map
|
|
132
|
-
$surface: map
|
|
134
|
+
$background: map.get($theme, background);
|
|
135
|
+
$surface: map.get($background, card);
|
|
133
136
|
@return $surface;
|
|
134
137
|
}
|
|
135
138
|
@function getSurfaceAlpha($theme){
|
|
136
|
-
$background: map
|
|
137
|
-
$surface-
|
|
138
|
-
@return $surface-alpha;
|
|
139
|
+
$background: map.get($theme, background);
|
|
140
|
+
$surface-color: map.get($background, card);
|
|
141
|
+
@return color.change($surface-color, $alpha: 0.5);
|
|
139
142
|
}
|
|
140
143
|
@function getSurfaceInverse($theme){
|
|
141
|
-
$background: map
|
|
142
|
-
$surface-inverse: map
|
|
144
|
+
$background: map.get($theme, background);
|
|
145
|
+
$surface-inverse: map.get($background, card-inverse);
|
|
143
146
|
@return $surface-inverse;
|
|
144
147
|
}
|
|
145
148
|
@function getSurfaceAlphaInverse($theme){
|
|
146
|
-
$background: map
|
|
147
|
-
$surface-
|
|
148
|
-
@return $surface-alpha
|
|
149
|
+
$background: map.get($theme, background);
|
|
150
|
+
$surface-color: map.get($background, card-inverse);
|
|
151
|
+
@return color.change($surface-color, $alpha: 0.5);
|
|
149
152
|
}
|
|
150
153
|
|
|
151
154
|
|
|
152
155
|
// Foreground
|
|
153
156
|
@function getForeground($theme){
|
|
154
|
-
$foreground: map
|
|
155
|
-
$foreground: map
|
|
157
|
+
$foreground: map.get($theme, foreground);
|
|
158
|
+
$foreground: map.get($foreground, text);
|
|
156
159
|
@return $foreground;
|
|
157
160
|
}
|
|
158
161
|
@function getForegroundInverse($theme){
|
|
159
|
-
$foreground: map
|
|
160
|
-
$foreground-inverse: map
|
|
162
|
+
$foreground: map.get($theme, foreground);
|
|
163
|
+
$foreground-inverse: map.get($foreground, text-inverse);
|
|
161
164
|
@return $foreground-inverse;
|
|
162
165
|
}
|
|
163
166
|
@function getForegroundAlpha($theme){
|
|
164
|
-
$foreground: map
|
|
165
|
-
$foreground-
|
|
166
|
-
@return $foreground-alpha;
|
|
167
|
+
$foreground: map.get($theme, foreground);
|
|
168
|
+
$foreground-color: map.get($foreground, text);
|
|
169
|
+
@return color.change($foreground-color, $alpha: 0.5);
|
|
167
170
|
}
|
|
168
171
|
@function getForegroundAlphaInverse($theme){
|
|
169
|
-
$foreground: map
|
|
170
|
-
$foreground-
|
|
171
|
-
@return $foreground-alpha
|
|
172
|
+
$foreground: map.get($theme, foreground);
|
|
173
|
+
$foreground-color: map.get($foreground, text-inverse);
|
|
174
|
+
@return color.change($foreground-color, $alpha: 0.5);
|
|
172
175
|
}
|
|
173
176
|
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
174
180
|
// Disabled
|
|
175
181
|
// #D4DDE3
|
|
176
182
|
@function getDisabled($theme){
|
|
177
|
-
$background: map
|
|
178
|
-
$disabled: map
|
|
183
|
+
$background: map.get($theme, background);
|
|
184
|
+
$disabled: map.get($background, disabled);
|
|
179
185
|
@return $disabled;
|
|
180
186
|
}
|
|
181
187
|
@function getDisabledBgContrast($theme){
|
|
182
|
-
$foreground: map
|
|
183
|
-
$disabled-contrast: map
|
|
188
|
+
$foreground: map.get($theme, foreground);
|
|
189
|
+
$disabled-contrast: map.get($foreground, disabled-contrast);
|
|
184
190
|
@return $disabled-contrast;
|
|
185
191
|
}
|
|
186
192
|
// rgba(0, 0, 0, 0.26),
|
|
187
193
|
@function getDisabledContrast($theme){
|
|
188
|
-
$foreground: map
|
|
189
|
-
$disabled-contrast: map
|
|
194
|
+
$foreground: map.get($theme, foreground);
|
|
195
|
+
$disabled-contrast: map.get($foreground, disabled);
|
|
190
196
|
@return $disabled-contrast;
|
|
191
197
|
}
|
|
192
198
|
// #D4DDE3 50%
|
|
193
|
-
@function getDisabledAlpha($theme){
|
|
194
|
-
$background: map
|
|
195
|
-
$disabled-
|
|
196
|
-
@return $disabled-alpha;
|
|
199
|
+
@function getDisabledAlpha($theme) {
|
|
200
|
+
$background: map.get($theme, background);
|
|
201
|
+
$disabled-color: map.get($background, disabled);
|
|
202
|
+
@return color.change($disabled-color, $alpha: 0.5);
|
|
197
203
|
}
|
|
198
204
|
// rgba(0, 0, 0, 0.13)
|
|
199
205
|
@function getDisabledContrastAlpha($theme){
|
|
200
|
-
$foreground: map
|
|
201
|
-
$disabled-contrast-alpha: rgba(map
|
|
206
|
+
$foreground: map.get($theme, foreground);
|
|
207
|
+
$disabled-contrast-alpha: rgba(map.get($foreground, disabled), 0.5);
|
|
202
208
|
@return $disabled-contrast-alpha;
|
|
203
209
|
}
|
|
204
210
|
|
|
@@ -207,12 +213,12 @@
|
|
|
207
213
|
// --------------------------------------------------------------------------------------------------------------------
|
|
208
214
|
// Red
|
|
209
215
|
@function getRed($theme) {
|
|
210
|
-
$red-color: map
|
|
216
|
+
$red-color: map.get($red, getShade($theme));
|
|
211
217
|
@return $red-color;
|
|
212
218
|
}
|
|
213
219
|
@function getRedContrast($theme) {
|
|
214
|
-
$red-contrast-palette: map
|
|
215
|
-
$red-contrast: map
|
|
220
|
+
$red-contrast-palette: map.get($red, 'contrast');
|
|
221
|
+
$red-contrast: map.get($red-contrast-palette, getShade($theme));
|
|
216
222
|
@return $red-contrast;
|
|
217
223
|
}
|
|
218
224
|
@function getRedAlpha($theme) {
|
|
@@ -228,12 +234,12 @@
|
|
|
228
234
|
|
|
229
235
|
// Pink
|
|
230
236
|
@function getPink($theme) {
|
|
231
|
-
$pink-color: map
|
|
237
|
+
$pink-color: map.get($pink, getShade($theme));
|
|
232
238
|
@return $pink-color;
|
|
233
239
|
}
|
|
234
240
|
@function getPinkContrast($theme) {
|
|
235
|
-
$pink-contrast-palette: map
|
|
236
|
-
$pink-contrast: map
|
|
241
|
+
$pink-contrast-palette: map.get($pink, 'contrast');
|
|
242
|
+
$pink-contrast: map.get($pink-contrast-palette, getShade($theme));
|
|
237
243
|
@return $pink-contrast;
|
|
238
244
|
}
|
|
239
245
|
@function getPinkAlpha($theme) {
|
|
@@ -249,12 +255,12 @@
|
|
|
249
255
|
|
|
250
256
|
// Purple
|
|
251
257
|
@function getPurple($theme) {
|
|
252
|
-
$purple-color: map
|
|
258
|
+
$purple-color: map.get($purple, getShade($theme));
|
|
253
259
|
@return $purple-color;
|
|
254
260
|
}
|
|
255
261
|
@function getPurpleContrast($theme) {
|
|
256
|
-
$purple-contrast-palette: map
|
|
257
|
-
$purple-contrast: map
|
|
262
|
+
$purple-contrast-palette: map.get($purple, 'contrast');
|
|
263
|
+
$purple-contrast: map.get($purple-contrast-palette, getShade($theme));
|
|
258
264
|
@return $purple-contrast;
|
|
259
265
|
}
|
|
260
266
|
@function getPurpleAlpha($theme) {
|
|
@@ -270,12 +276,12 @@
|
|
|
270
276
|
|
|
271
277
|
// Deep Purple
|
|
272
278
|
@function getDeepPurple($theme) {
|
|
273
|
-
$deep-purple-color: map
|
|
279
|
+
$deep-purple-color: map.get($deep-purple, getShade($theme));
|
|
274
280
|
@return $deep-purple-color;
|
|
275
281
|
}
|
|
276
282
|
@function getDeepPurpleContrast($theme) {
|
|
277
|
-
$deep-purple-contrast-palette: map
|
|
278
|
-
$deep-purple-contrast: map
|
|
283
|
+
$deep-purple-contrast-palette: map.get($deep-purple, 'contrast');
|
|
284
|
+
$deep-purple-contrast: map.get($deep-purple-contrast-palette, getShade($theme));
|
|
279
285
|
@return $deep-purple-contrast;
|
|
280
286
|
}
|
|
281
287
|
@function getDeepPurpleAlpha($theme) {
|
|
@@ -291,12 +297,12 @@
|
|
|
291
297
|
|
|
292
298
|
// Indigo
|
|
293
299
|
@function getIndigo($theme) {
|
|
294
|
-
$indigo-color: map
|
|
300
|
+
$indigo-color: map.get($indigo, getShade($theme));
|
|
295
301
|
@return $indigo-color;
|
|
296
302
|
}
|
|
297
303
|
@function getIndigoContrast($theme) {
|
|
298
|
-
$indigo-contrast-palette: map
|
|
299
|
-
$indigo-contrast: map
|
|
304
|
+
$indigo-contrast-palette: map.get($indigo, 'contrast');
|
|
305
|
+
$indigo-contrast: map.get($indigo-contrast-palette, getShade($theme));
|
|
300
306
|
@return $indigo-contrast;
|
|
301
307
|
}
|
|
302
308
|
@function getIndigoAlpha($theme) {
|
|
@@ -312,12 +318,12 @@
|
|
|
312
318
|
|
|
313
319
|
// Blue
|
|
314
320
|
@function getBlue($theme) {
|
|
315
|
-
$blue-color: map
|
|
321
|
+
$blue-color: map.get($blue, getShade($theme));
|
|
316
322
|
@return $blue-color;
|
|
317
323
|
}
|
|
318
324
|
@function getBlueContrast($theme) {
|
|
319
|
-
$blue-contrast-palette: map
|
|
320
|
-
$blue-contrast: map
|
|
325
|
+
$blue-contrast-palette: map.get($blue, 'contrast');
|
|
326
|
+
$blue-contrast: map.get($blue-contrast-palette, getShade($theme));
|
|
321
327
|
@return $blue-contrast;
|
|
322
328
|
}
|
|
323
329
|
@function getBlueAlpha($theme) {
|
|
@@ -333,12 +339,12 @@
|
|
|
333
339
|
|
|
334
340
|
// Light Blue
|
|
335
341
|
@function getLightBlue($theme) {
|
|
336
|
-
$light-blue-color: map
|
|
342
|
+
$light-blue-color: map.get($light-blue, getShade($theme));
|
|
337
343
|
@return $light-blue-color;
|
|
338
344
|
}
|
|
339
345
|
@function getLightBlueContrast($theme) {
|
|
340
|
-
$light-blue-contrast-palette: map
|
|
341
|
-
$light-blue-contrast: map
|
|
346
|
+
$light-blue-contrast-palette: map.get($light-blue, 'contrast');
|
|
347
|
+
$light-blue-contrast: map.get($light-blue-contrast-palette, getShade($theme));
|
|
342
348
|
@return $light-blue-contrast;
|
|
343
349
|
}
|
|
344
350
|
@function getLightBlueAlpha($theme) {
|
|
@@ -354,12 +360,12 @@
|
|
|
354
360
|
|
|
355
361
|
// Cyan
|
|
356
362
|
@function getCyan($theme) {
|
|
357
|
-
$cyan-color: map
|
|
363
|
+
$cyan-color: map.get($cyan, getShade($theme));
|
|
358
364
|
@return $cyan-color;
|
|
359
365
|
}
|
|
360
366
|
@function getCyanContrast($theme) {
|
|
361
|
-
$cyan-contrast-palette: map
|
|
362
|
-
$cyan-contrast: map
|
|
367
|
+
$cyan-contrast-palette: map.get($cyan, 'contrast');
|
|
368
|
+
$cyan-contrast: map.get($cyan-contrast-palette, getShade($theme));
|
|
363
369
|
@return $cyan-contrast;
|
|
364
370
|
}
|
|
365
371
|
@function getCyanAlpha($theme) {
|
|
@@ -375,12 +381,12 @@
|
|
|
375
381
|
|
|
376
382
|
// Teal
|
|
377
383
|
@function getTeal($theme) {
|
|
378
|
-
$teal-color: map
|
|
384
|
+
$teal-color: map.get($teal, getShade($theme));
|
|
379
385
|
@return $teal-color;
|
|
380
386
|
}
|
|
381
387
|
@function getTealContrast($theme) {
|
|
382
|
-
$teal-contrast-palette: map
|
|
383
|
-
$teal-contrast: map
|
|
388
|
+
$teal-contrast-palette: map.get($teal, 'contrast');
|
|
389
|
+
$teal-contrast: map.get($teal-contrast-palette, getShade($theme));
|
|
384
390
|
@return $teal-contrast;
|
|
385
391
|
}
|
|
386
392
|
@function getTealAlpha($theme) {
|
|
@@ -396,12 +402,12 @@
|
|
|
396
402
|
|
|
397
403
|
// Green
|
|
398
404
|
@function getGreen($theme) {
|
|
399
|
-
$green-color: map
|
|
405
|
+
$green-color: map.get($green, getShade($theme));
|
|
400
406
|
@return $green-color;
|
|
401
407
|
}
|
|
402
408
|
@function getGreenContrast($theme) {
|
|
403
|
-
$green-contrast-palette: map
|
|
404
|
-
$green-contrast: map
|
|
409
|
+
$green-contrast-palette: map.get($green, 'contrast');
|
|
410
|
+
$green-contrast: map.get($green-contrast-palette, getShade($theme));
|
|
405
411
|
@return $green-contrast;
|
|
406
412
|
}
|
|
407
413
|
@function getGreenAlpha($theme) {
|
|
@@ -417,12 +423,12 @@
|
|
|
417
423
|
|
|
418
424
|
// Light Green
|
|
419
425
|
@function getLightGreen($theme) {
|
|
420
|
-
$light-green-color: map
|
|
426
|
+
$light-green-color: map.get($light-green, getShade($theme));
|
|
421
427
|
@return $light-green-color;
|
|
422
428
|
}
|
|
423
429
|
@function getLightGreenContrast($theme) {
|
|
424
|
-
$light-green-contrast-palette: map
|
|
425
|
-
$light-green-contrast: map
|
|
430
|
+
$light-green-contrast-palette: map.get($light-green, 'contrast');
|
|
431
|
+
$light-green-contrast: map.get($light-green-contrast-palette, getShade($theme));
|
|
426
432
|
@return $light-green-contrast;
|
|
427
433
|
}
|
|
428
434
|
@function getLightGreenAlpha($theme) {
|
|
@@ -438,12 +444,12 @@
|
|
|
438
444
|
|
|
439
445
|
// Lime
|
|
440
446
|
@function getLime($theme) {
|
|
441
|
-
$lime-color: map
|
|
447
|
+
$lime-color: map.get($lime, getShade($theme));
|
|
442
448
|
@return $lime-color;
|
|
443
449
|
}
|
|
444
450
|
@function getLimeContrast($theme) {
|
|
445
|
-
$lime-contrast-palette: map
|
|
446
|
-
$lime-contrast: map
|
|
451
|
+
$lime-contrast-palette: map.get($lime, 'contrast');
|
|
452
|
+
$lime-contrast: map.get($lime-contrast-palette, getShade($theme));
|
|
447
453
|
@return $lime-contrast;
|
|
448
454
|
}
|
|
449
455
|
@function getLimeAlpha($theme) {
|
|
@@ -459,12 +465,12 @@
|
|
|
459
465
|
|
|
460
466
|
// Yellow
|
|
461
467
|
@function getYellow($theme) {
|
|
462
|
-
$yellow-color: map
|
|
468
|
+
$yellow-color: map.get($yellow, getShade($theme));
|
|
463
469
|
@return $yellow-color;
|
|
464
470
|
}
|
|
465
471
|
@function getYellowContrast($theme) {
|
|
466
|
-
$yellow-contrast-palette: map
|
|
467
|
-
$yellow-contrast: map
|
|
472
|
+
$yellow-contrast-palette: map.get($yellow, 'contrast');
|
|
473
|
+
$yellow-contrast: map.get($yellow-contrast-palette, getShade($theme));
|
|
468
474
|
@return $yellow-contrast;
|
|
469
475
|
}
|
|
470
476
|
@function getYellowAlpha($theme) {
|
|
@@ -480,12 +486,12 @@
|
|
|
480
486
|
|
|
481
487
|
// Amber
|
|
482
488
|
@function getAmber($theme) {
|
|
483
|
-
$amber-color: map
|
|
489
|
+
$amber-color: map.get($amber, getShade($theme));
|
|
484
490
|
@return $amber-color;
|
|
485
491
|
}
|
|
486
492
|
@function getAmberContrast($theme) {
|
|
487
|
-
$amber-contrast-palette: map
|
|
488
|
-
$amber-contrast: map
|
|
493
|
+
$amber-contrast-palette: map.get($amber, 'contrast');
|
|
494
|
+
$amber-contrast: map.get($amber-contrast-palette, getShade($theme));
|
|
489
495
|
@return $amber-contrast;
|
|
490
496
|
}
|
|
491
497
|
@function getAmberAlpha($theme) {
|
|
@@ -501,12 +507,12 @@
|
|
|
501
507
|
|
|
502
508
|
// Orange
|
|
503
509
|
@function getOrange($theme) {
|
|
504
|
-
$orange-color: map
|
|
510
|
+
$orange-color: map.get($orange, getShade($theme));
|
|
505
511
|
@return $orange-color;
|
|
506
512
|
}
|
|
507
513
|
@function getOrangeContrast($theme) {
|
|
508
|
-
$orange-contrast-palette: map
|
|
509
|
-
$orange-contrast: map
|
|
514
|
+
$orange-contrast-palette: map.get($orange, 'contrast');
|
|
515
|
+
$orange-contrast: map.get($orange-contrast-palette, getShade($theme));
|
|
510
516
|
@return $orange-contrast;
|
|
511
517
|
}
|
|
512
518
|
@function getOrangeAlpha($theme) {
|
|
@@ -522,12 +528,12 @@
|
|
|
522
528
|
|
|
523
529
|
// Deep Orange
|
|
524
530
|
@function getDeepOrange($theme) {
|
|
525
|
-
$deep-orange-color: map
|
|
531
|
+
$deep-orange-color: map.get($deep-orange, getShade($theme));
|
|
526
532
|
@return $deep-orange-color;
|
|
527
533
|
}
|
|
528
534
|
@function getDeepOrangeContrast($theme) {
|
|
529
|
-
$deep-orange-contrast-palette: map
|
|
530
|
-
$deep-orange-contrast: map
|
|
535
|
+
$deep-orange-contrast-palette: map.get($deep-orange, 'contrast');
|
|
536
|
+
$deep-orange-contrast: map.get($deep-orange-contrast-palette, getShade($theme));
|
|
531
537
|
@return $deep-orange-contrast;
|
|
532
538
|
}
|
|
533
539
|
@function getDeepOrangeAlpha($theme) {
|
|
@@ -543,12 +549,12 @@
|
|
|
543
549
|
|
|
544
550
|
// Brown
|
|
545
551
|
@function getBrown($theme) {
|
|
546
|
-
$brown-color: map
|
|
552
|
+
$brown-color: map.get($brown, getShade($theme));
|
|
547
553
|
@return $brown-color;
|
|
548
554
|
}
|
|
549
555
|
@function getBrownContrast($theme) {
|
|
550
|
-
$brown-contrast-palette: map
|
|
551
|
-
$brown-contrast: map
|
|
556
|
+
$brown-contrast-palette: map.get($brown, 'contrast');
|
|
557
|
+
$brown-contrast: map.get($brown-contrast-palette, getShade($theme));
|
|
552
558
|
@return $brown-contrast;
|
|
553
559
|
}
|
|
554
560
|
@function getBrownAlpha($theme) {
|
|
@@ -564,12 +570,12 @@
|
|
|
564
570
|
|
|
565
571
|
// Grey
|
|
566
572
|
@function getGrey($theme) {
|
|
567
|
-
$grey-color: map
|
|
573
|
+
$grey-color: map.get($grey, getShade($theme));
|
|
568
574
|
@return $grey-color;
|
|
569
575
|
}
|
|
570
576
|
@function getGreyContrast($theme) {
|
|
571
|
-
$grey-contrast-palette: map
|
|
572
|
-
$grey-contrast: map
|
|
577
|
+
$grey-contrast-palette: map.get($grey, 'contrast');
|
|
578
|
+
$grey-contrast: map.get($grey-contrast-palette, getShade($theme));
|
|
573
579
|
@return $grey-contrast;
|
|
574
580
|
}
|
|
575
581
|
@function getGreyAlpha($theme) {
|
|
@@ -585,12 +591,12 @@
|
|
|
585
591
|
|
|
586
592
|
// Blue Grey
|
|
587
593
|
@function getBlueGrey($theme) {
|
|
588
|
-
$blue-grey-color: map
|
|
594
|
+
$blue-grey-color: map.get($blue-grey, getShade($theme));
|
|
589
595
|
@return $blue-grey-color;
|
|
590
596
|
}
|
|
591
597
|
@function getBlueGreyContrast($theme) {
|
|
592
|
-
$blue-grey-contrast-palette: map
|
|
593
|
-
$blue-grey-contrast: map
|
|
598
|
+
$blue-grey-contrast-palette: map.get($blue-grey, 'contrast');
|
|
599
|
+
$blue-grey-contrast: map.get($blue-grey-contrast-palette, getShade($theme));
|
|
594
600
|
@return $blue-grey-contrast;
|
|
595
601
|
}
|
|
596
602
|
@function getBlueGreyAlpha($theme) {
|
|
@@ -606,13 +612,13 @@
|
|
|
606
612
|
|
|
607
613
|
// Primary
|
|
608
614
|
@function getPrimary($theme) {
|
|
609
|
-
$primary: map
|
|
610
|
-
$primary-color: map
|
|
615
|
+
$primary: map.get($theme, primary);
|
|
616
|
+
$primary-color: map.get($primary, default);
|
|
611
617
|
@return $primary-color;
|
|
612
618
|
}
|
|
613
619
|
@function getPrimaryContrast($theme) {
|
|
614
|
-
$primary: map
|
|
615
|
-
$primary-contrast: map
|
|
620
|
+
$primary: map.get($theme, primary);
|
|
621
|
+
$primary-contrast: map.get($primary, default-contrast);
|
|
616
622
|
@return $primary-contrast;
|
|
617
623
|
}
|
|
618
624
|
@function getPrimaryAlpha($theme) {
|
|
@@ -628,13 +634,13 @@
|
|
|
628
634
|
|
|
629
635
|
// Accent
|
|
630
636
|
@function getAccent($theme) {
|
|
631
|
-
$accent: map
|
|
632
|
-
$accent-color: map
|
|
637
|
+
$accent: map.get($theme, accent);
|
|
638
|
+
$accent-color: map.get($accent, default);
|
|
633
639
|
@return $accent-color;
|
|
634
640
|
}
|
|
635
641
|
@function getAccentContrast($theme) {
|
|
636
|
-
$accent: map
|
|
637
|
-
$accent-contrast: map
|
|
642
|
+
$accent: map.get($theme, accent);
|
|
643
|
+
$accent-contrast: map.get($accent, default-contrast);
|
|
638
644
|
@return $accent-contrast;
|
|
639
645
|
}
|
|
640
646
|
@function getAccentAlpha($theme) {
|
|
@@ -650,13 +656,13 @@
|
|
|
650
656
|
|
|
651
657
|
// Warn
|
|
652
658
|
@function getWarn($theme) {
|
|
653
|
-
$warn: map
|
|
654
|
-
$warn-color: map
|
|
659
|
+
$warn: map.get($theme, warn);
|
|
660
|
+
$warn-color: map.get($warn, default);
|
|
655
661
|
@return $warn-color;
|
|
656
662
|
}
|
|
657
663
|
@function getWarnContrast($theme) {
|
|
658
|
-
$warn: map
|
|
659
|
-
$warn-contrast: map
|
|
664
|
+
$warn: map.get($theme, warn);
|
|
665
|
+
$warn-contrast: map.get($warn, default-contrast);
|
|
660
666
|
@return $warn-contrast;
|
|
661
667
|
}
|
|
662
668
|
@function getWarnAlpha($theme) {
|
|
@@ -689,7 +695,7 @@
|
|
|
689
695
|
@return map-color($palette, default, $hue);
|
|
690
696
|
}
|
|
691
697
|
|
|
692
|
-
$color: map
|
|
698
|
+
$color: map.get($palette, $hue);
|
|
693
699
|
|
|
694
700
|
@if (type-of($color) !=color) {
|
|
695
701
|
// If the $color resolved to something different from a color (e.g. a CSS variable),
|
|
@@ -810,14 +816,14 @@
|
|
|
810
816
|
// Loop through the levels and set the `font-family` of the ones that don't have one to the base.
|
|
811
817
|
// Note that Sass can't modify maps in place, which means that we need to merge and re-assign.
|
|
812
818
|
@each $key, $level in $config {
|
|
813
|
-
@if map
|
|
814
|
-
$new-level: map
|
|
819
|
+
@if map.get($level, font-family) == null {
|
|
820
|
+
$new-level: map.merge(
|
|
815
821
|
$level,
|
|
816
822
|
(
|
|
817
823
|
font-family: $font-family
|
|
818
824
|
)
|
|
819
825
|
);
|
|
820
|
-
$config: map
|
|
826
|
+
$config: map.merge(
|
|
821
827
|
$config,
|
|
822
828
|
(
|
|
823
829
|
$key: $new-level
|
|
@@ -827,7 +833,7 @@
|
|
|
827
833
|
}
|
|
828
834
|
|
|
829
835
|
// Add the base font family to the config.
|
|
830
|
-
@return map
|
|
836
|
+
@return map.merge(
|
|
831
837
|
$config,
|
|
832
838
|
(
|
|
833
839
|
font-family: $font-family
|
|
@@ -837,7 +843,7 @@
|
|
|
837
843
|
|
|
838
844
|
// Utility for fetching a nested value from a typography config.
|
|
839
845
|
@function _matcha-get-type-value($config, $level, $name) {
|
|
840
|
-
@return map
|
|
846
|
+
@return map.get(map.get($config, $level), $name);
|
|
841
847
|
}
|
|
842
848
|
|
|
843
849
|
// Gets the font size for a level inside a typography config.
|
|
@@ -862,7 +868,7 @@
|
|
|
862
868
|
|
|
863
869
|
// Gets the font-family from a typography config and removes the quotes around it.
|
|
864
870
|
@function matcha-font-family($config, $level: null) {
|
|
865
|
-
$font-family: map
|
|
871
|
+
$font-family: map.get($config, font-family);
|
|
866
872
|
|
|
867
873
|
@if $level !=null {
|
|
868
874
|
$font-family: _matcha-get-type-value($config, $level, font-family);
|
|
@@ -997,4 +1003,4 @@ $base-font-size: 16px;
|
|
|
997
1003
|
} @else {
|
|
998
1004
|
@return $value-in-px;
|
|
999
1005
|
}
|
|
1000
|
-
}
|
|
1006
|
+
}
|