matcha-theme 20.270.0 → 20.271.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.
@@ -1,601 +1,94 @@
1
1
  @mixin matcha-radio($theme) {
2
- matcha-radio {
2
+ $color-functions: (
3
+ red: getRed,
4
+ pink: getPink,
5
+ purple: getPurple,
6
+ deep-purple: getDeepPurple,
7
+ indigo: getIndigo,
8
+ blue: getBlue,
9
+ light-blue: getLightBlue,
10
+ cyan: getCyan,
11
+ teal: getTeal,
12
+ green: getGreen,
13
+ light-green: getLightGreen,
14
+ lime: getLime,
15
+ yellow: getYellow,
16
+ amber: getAmber,
17
+ orange: getOrange,
18
+ deep-orange: getDeepOrange,
19
+ brown: getBrown,
20
+ grey: getGrey,
21
+ blue-grey: getBlueGrey,
22
+ primary: getPrimary,
23
+ accent: getAccent,
24
+ success: getSuccess,
25
+ warn: getWarn,
26
+ danger: getDanger,
27
+ info: getInfo,
28
+ );
3
29
 
4
- //normal use accent color
30
+ matcha-radio {
31
+ // default (no color) → uses accent
5
32
  &:not([color]) {
6
33
  input[type="radio"] {
7
- border-color: getBlueGrey($theme);
34
+ box-shadow: 0px 0px 0px 2px getBlueGrey($theme) inset;
8
35
 
9
- &:active {
10
- border-color: getAccent($theme);
11
- }
12
-
13
- &:checked {
14
- border-color: getAccent($theme);
36
+ &:active:not(:disabled),
37
+ &:checked:not(:disabled) {
38
+ box-shadow: 0px 0px 0px 2px getAccent($theme) inset,
39
+ 0px 0px 0px 5px getSurface($theme) inset,
40
+ 0px 0px 0px 10px getAccent($theme) inset;
15
41
 
16
- &::after {
17
- background-color: getAccent($theme);
18
- }
42
+ &::after { background-color: transparent; }
19
43
  }
20
-
21
44
  }
22
45
 
23
46
  .matcha-radio-container {
24
- &:hover {
25
- background-color: rgba(getAccent($theme), 0.1);
26
- }
27
-
28
- .ripple {
29
- background: rgba(getAccent($theme), 0.2) !important;
30
- }
47
+ &:hover { background-color: rgba(getAccent($theme), 0.1); }
48
+ .ripple { background: rgba(getAccent($theme), 0.2) !important; }
31
49
  }
32
50
  }
33
51
 
34
- //use custom color
52
+ // idle ring for all color variants
35
53
  &[color] {
36
54
  input[type="radio"] {
37
- border-color: getBlueGrey($theme);
38
- }
39
-
40
- }
41
-
42
- // red
43
- &[color="red"] {
44
- input[type="radio"]:active {
45
- border-color: getRed($theme);
46
- }
47
-
48
- input[type="radio"]:checked {
49
- border-color: getRed($theme);
50
- }
51
-
52
- input[type="radio"]:checked::after {
53
- background-color: getRed($theme);
54
- }
55
-
56
- .matcha-radio-container:hover {
57
- background-color: rgba(getRed($theme), 0.1);
58
- }
59
-
60
- .matcha-radio-container .ripple {
61
- background: rgba(getRedContrast($theme), 0.2) !important;
62
- }
63
- }
64
-
65
- &[color="pink"] {
66
- input[type="radio"]:active {
67
- border-color: getPink($theme);
68
- }
69
-
70
- input[type="radio"]:checked {
71
- border-color: getPink($theme);
72
- }
73
-
74
- input[type="radio"]:checked::after {
75
- background-color: getPink($theme);
76
- }
77
-
78
- .matcha-radio-container:hover {
79
- background-color: rgba(getPink($theme), 0.1);
80
- }
81
-
82
- .matcha-radio-container .ripple {
83
- background: rgba(getPinkContrast($theme), 0.2) !important;
84
- }
85
- }
86
-
87
- &[color="purple"] {
88
- input[type="radio"]:active {
89
- border-color: getPurple($theme);
90
- }
91
-
92
- input[type="radio"]:checked {
93
- border-color: getPurple($theme);
94
- }
95
-
96
- input[type="radio"]:checked::after {
97
- background-color: getPurple($theme);
98
- }
99
-
100
- .matcha-radio-container:hover {
101
- background-color: rgba(getPurple($theme), 0.1);
102
- }
103
-
104
- .matcha-radio-container .ripple {
105
- background: rgba(getPurpleContrast($theme), 0.2) !important;
55
+ box-shadow: 0px 0px 0px 2px getBlueGrey($theme) inset;
106
56
  }
107
57
  }
108
58
 
109
- &[color="deep-purple"] {
110
- input[type="radio"]:active {
111
- border-color: getDeepPurple($theme);
112
- }
113
-
114
- input[type="radio"]:checked {
115
- border-color: getDeepPurple($theme);
116
- }
117
-
118
- input[type="radio"]:checked::after {
119
- background-color: getDeepPurple($theme);
120
- }
121
-
122
- .matcha-radio-container:hover {
123
- background-color: rgba(getDeepPurple($theme), 0.1);
124
- }
125
-
126
- .matcha-radio-container .ripple {
127
- background: rgba(getDeepPurpleContrast($theme), 0.2) !important;
128
- }
129
- }
130
-
131
- &[color="indigo"] {
132
- input[type="radio"]:active {
133
- border-color: getIndigo($theme);
134
- }
59
+ // color variations
60
+ @each $colorName, $colorFn in $color-functions {
61
+ &[color="#{$colorName}"] {
62
+ input[type="radio"] {
63
+ &:active:not(:disabled),
64
+ &:checked:not(:disabled) {
65
+ box-shadow: 0px 0px 0px 2px call(#{$colorFn}, $theme) inset,
66
+ 0px 0px 0px 5px getSurface($theme) inset,
67
+ 0px 0px 0px 10px call(#{$colorFn}, $theme) inset;
135
68
 
136
- input[type="radio"]:checked {
137
- border-color: getIndigo($theme);
138
- }
139
-
140
- input[type="radio"]:checked::after {
141
- background-color: getIndigo($theme);
142
- }
143
-
144
- .matcha-radio-container:hover {
145
- background-color: rgba(getIndigo($theme), 0.1);
146
- }
147
-
148
- .matcha-radio-container .ripple {
149
- background: rgba(getIndigoContrast($theme), 0.2) !important;
150
- }
151
- }
152
-
153
- &[color="blue"] {
154
- input[type="radio"]:active {
155
- border-color: getBlue($theme);
156
- }
157
-
158
- input[type="radio"]:checked {
159
- border-color: getBlue($theme);
160
- }
161
-
162
- input[type="radio"]:checked::after {
163
- background-color: getBlue($theme);
164
- }
165
-
166
- .matcha-radio-container:hover {
167
- background-color: rgba(getBlue($theme), 0.1);
168
- }
169
-
170
- .matcha-radio-container .ripple {
171
- background: rgba(getBlueContrast($theme), 0.2) !important;
172
- }
173
- }
174
-
175
- &[color="light-blue"] {
176
- input[type="radio"]:active {
177
- border-color: getLightBlue($theme);
178
- }
179
-
180
- input[type="radio"]:checked {
181
- border-color: getLightBlue($theme);
182
- }
183
-
184
- input[type="radio"]:checked::after {
185
- background-color: getLightBlue($theme);
186
- }
187
-
188
- .matcha-radio-container:hover {
189
- background-color: rgba(getLightBlue($theme), 0.1);
190
- }
191
-
192
- .matcha-radio-container .ripple {
193
- background: rgba(getLightBlueContrast($theme), 0.2) !important;
194
- }
195
- }
196
-
197
- &[color="cyan"] {
198
- input[type="radio"]:active {
199
- border-color: getCyan($theme);
200
- }
201
-
202
- input[type="radio"]:checked {
203
- border-color: getCyan($theme);
204
- }
205
-
206
- input[type="radio"]:checked::after {
207
- background-color: getCyan($theme);
208
- }
209
-
210
- .matcha-radio-container:hover {
211
- background-color: rgba(getCyan($theme), 0.1);
212
- }
213
-
214
- .matcha-radio-container .ripple {
215
- background: rgba(getCyanContrast($theme), 0.2) !important;
216
- }
217
- }
218
-
219
- &[color="teal"] {
220
- input[type="radio"]:active {
221
- border-color: getTeal($theme);
222
- }
223
-
224
- input[type="radio"]:checked {
225
- border-color: getTeal($theme);
226
- }
227
-
228
- input[type="radio"]:checked::after {
229
- background-color: getTeal($theme);
230
- }
231
-
232
- .matcha-radio-container:hover {
233
- background-color: rgba(getTeal($theme), 0.1);
234
- }
235
-
236
- .matcha-radio-container .ripple {
237
- background: rgba(getTealContrast($theme), 0.2) !important;
238
- }
239
- }
240
-
241
- &[color="green"] {
242
- input[type="radio"]:active {
243
- border-color: getGreen($theme);
244
- }
245
-
246
- input[type="radio"]:checked {
247
- border-color: getGreen($theme);
248
- }
249
-
250
- input[type="radio"]:checked::after {
251
- background-color: getGreen($theme);
252
- }
253
-
254
- .matcha-radio-container:hover {
255
- background-color: rgba(getGreen($theme), 0.1);
256
- }
257
-
258
- .matcha-radio-container .ripple {
259
- background: rgba(getGreenContrast($theme), 0.2) !important;
260
- }
261
- }
262
-
263
- &[color="light-green"] {
264
- input[type="radio"]:active {
265
- border-color: getLightGreen($theme);
266
- }
267
-
268
- input[type="radio"]:checked {
269
- border-color: getLightGreen($theme);
270
- }
271
-
272
- input[type="radio"]:checked::after {
273
- background-color: getLightGreen($theme);
274
- }
275
-
276
- .matcha-radio-container:hover {
277
- background-color: rgba(getLightGreen($theme), 0.1);
278
- }
279
-
280
- .matcha-radio-container .ripple {
281
- background: rgba(getLightGreenContrast($theme), 0.2) !important;
282
- }
283
- }
284
-
285
- &[color="lime"] {
286
- input[type="radio"]:active {
287
- border-color: getLime($theme);
288
- }
289
-
290
- input[type="radio"]:checked {
291
- border-color: getLime($theme);
292
- }
293
-
294
- input[type="radio"]:checked::after {
295
- background-color: getLime($theme);
296
- }
297
-
298
- .matcha-radio-container:hover {
299
- background-color: rgba(getLime($theme), 0.1);
300
- }
301
-
302
- .matcha-radio-container .ripple {
303
- background: rgba(getLimeContrast($theme), 0.2) !important;
304
- }
305
- }
306
-
307
- &[color="yellow"] {
308
- input[type="radio"]:active {
309
- border-color: getYellow($theme);
310
- }
311
-
312
- input[type="radio"]:checked {
313
- border-color: getYellow($theme);
314
- }
315
-
316
- input[type="radio"]:checked::after {
317
- background-color: getYellow($theme);
318
- }
319
-
320
- .matcha-radio-container:hover {
321
- background-color: rgba(getYellow($theme), 0.1);
322
- }
323
-
324
- .matcha-radio-container .ripple {
325
- background: rgba(getYellowContrast($theme), 0.2) !important;
326
- }
327
- }
328
-
329
- &[color="amber"] {
330
- input[type="radio"]:active {
331
- border-color: getAmber($theme);
332
- }
333
-
334
- input[type="radio"]:checked {
335
- border-color: getAmber($theme);
336
- }
337
-
338
- input[type="radio"]:checked::after {
339
- background-color: getAmber($theme);
340
- }
341
-
342
- .matcha-radio-container:hover {
343
- background-color: rgba(getAmber($theme), 0.1);
344
- }
345
-
346
- .matcha-radio-container .ripple {
347
- background: rgba(getAmberContrast($theme), 0.2) !important;
348
- }
349
- }
350
-
351
- &[color="orange"] {
352
- input[type="radio"]:active {
353
- border-color: getOrange($theme);
354
- }
355
-
356
- input[type="radio"]:checked {
357
- border-color: getOrange($theme);
358
- }
359
-
360
- input[type="radio"]:checked::after {
361
- background-color: getOrange($theme);
362
- }
363
-
364
- .matcha-radio-container:hover {
365
- background-color: rgba(getOrange($theme), 0.1);
366
- }
367
-
368
- .matcha-radio-container .ripple {
369
- background: rgba(getOrangeContrast($theme), 0.2) !important;
370
- }
371
- }
372
-
373
- &[color="deep-orange"] {
374
- input[type="radio"]:active {
375
- border-color: getDeepOrange($theme);
376
- }
377
-
378
- input[type="radio"]:checked {
379
- border-color: getDeepOrange($theme);
380
- }
381
-
382
- input[type="radio"]:checked::after {
383
- background-color: getDeepOrange($theme);
384
- }
385
-
386
- .matcha-radio-container:hover {
387
- background-color: rgba(getDeepOrange($theme), 0.1);
388
- }
389
-
390
- .matcha-radio-container .ripple {
391
- background: rgba(getDeepOrangeContrast($theme), 0.2) !important;
392
- }
393
- }
394
-
395
- &[color="brown"] {
396
- input[type="radio"]:active {
397
- border-color: getBrown($theme);
398
- }
399
-
400
- input[type="radio"]:checked {
401
- border-color: getBrown($theme);
402
- }
403
-
404
- input[type="radio"]:checked::after {
405
- background-color: getBrown($theme);
406
- }
407
-
408
- .matcha-radio-container:hover {
409
- background-color: rgba(getBrown($theme), 0.1);
410
- }
411
-
412
- .matcha-radio-container .ripple {
413
- background: rgba(getBrownContrast($theme), 0.2) !important;
414
- }
415
- }
416
-
417
- &[color="grey"] {
418
- input[type="radio"]:active {
419
- border-color: getGrey($theme);
420
- }
421
-
422
- input[type="radio"]:checked {
423
- border-color: getGrey($theme);
424
- }
425
-
426
- input[type="radio"]:checked::after {
427
- background-color: getGrey($theme);
428
- }
429
-
430
- .matcha-radio-container:hover {
431
- background-color: rgba(getGrey($theme), 0.1);
432
- }
433
-
434
- .matcha-radio-container .ripple {
435
- background: rgba(getGreyContrast($theme), 0.2) !important;
436
- }
437
- }
438
-
439
- &[color="blue-grey"] {
440
- input[type="radio"]:active {
441
- border-color: getBlueGrey($theme);
442
- }
443
-
444
- input[type="radio"]:checked {
445
- border-color: getBlueGrey($theme);
446
- }
447
-
448
- input[type="radio"]:checked::after {
449
- background-color: getBlueGrey($theme);
450
- }
451
-
452
- .matcha-radio-container:hover {
453
- background-color: rgba(getBlueGrey($theme), 0.1);
454
- }
455
-
456
- .matcha-radio-container .ripple {
457
- background: rgba(getBlueGreyContrast($theme), 0.2) !important;
458
- }
459
- }
460
-
461
- // primary
462
- &[color="primary"] {
463
- input[type="radio"]:active {
464
- border-color: getPrimary($theme);
465
- }
466
-
467
- input[type="radio"]:checked {
468
- border-color: getPrimary($theme);
469
- }
470
-
471
- input[type="radio"]:checked::after {
472
- background-color: getPrimary($theme);
473
- }
474
-
475
- .matcha-radio-container:hover {
476
- background-color: rgba(getPrimary($theme), 0.1);
477
- }
478
-
479
- .matcha-radio-container .ripple {
480
- background: rgba(getPrimaryContrast($theme), 0.2) !important;
481
- }
482
- }
483
-
484
- // accent
485
- &[color="accent"] {
486
- input[type="radio"]:active {
487
- border-color: getAccent($theme);
488
- }
489
-
490
- input[type="radio"]:checked {
491
- border-color: getAccent($theme);
492
- }
493
-
494
- input[type="radio"]:checked::after {
495
- background-color: getAccent($theme);
496
- }
497
-
498
- .matcha-radio-container:hover {
499
- background-color: rgba(getAccent($theme), 0.1);
500
- }
501
-
502
- .matcha-radio-container .ripple {
503
- background: rgba(getAccentContrast($theme), 0.2) !important;
504
- }
505
- }
506
-
507
- &[color="success"] {
508
- input[type="radio"]:active {
509
- border-color: getSuccess($theme);
510
- }
511
-
512
- input[type="radio"]:checked {
513
- border-color: getSuccess($theme);
514
- }
515
-
516
- input[type="radio"]:checked::after {
517
- background-color: getSuccess($theme);
518
- }
519
-
520
- .matcha-radio-container:hover {
521
- background-color: rgba(getSuccess($theme), 0.1);
522
- }
523
-
524
- .matcha-radio-container .ripple {
525
- background: rgba(getSuccessContrast($theme), 0.2) !important;
526
- }
527
- }
528
-
529
- &[color="warn"] {
530
- input[type="radio"]:active {
531
- border-color: getWarn($theme);
532
- }
533
-
534
- input[type="radio"]:checked {
535
- border-color: getWarn($theme);
536
- }
537
-
538
- input[type="radio"]:checked::after {
539
- background-color: getWarn($theme);
540
- }
541
-
542
- .matcha-radio-container:hover {
543
- background-color: rgba(getWarn($theme), 0.1);
544
- }
545
-
546
- .matcha-radio-container .ripple {
547
- background: rgba(getWarnContrast($theme), 0.2) !important;
548
- }
549
- }
550
-
551
- &[color="danger"] {
552
- input[type="radio"]:active {
553
- border-color: getDanger($theme);
554
- }
555
-
556
- input[type="radio"]:checked {
557
- border-color: getDanger($theme);
558
- }
559
-
560
- input[type="radio"]:checked::after {
561
- background-color: getDanger($theme);
562
- }
563
-
564
- .matcha-radio-container:hover {
565
- background-color: rgba(getDanger($theme), 0.1);
566
- }
567
-
568
- .matcha-radio-container .ripple {
569
- background: rgba(getDangerContrast($theme), 0.2) !important;
570
- }
571
- }
572
-
573
- &[color="info"] {
574
- input[type="radio"]:active {
575
- border-color: getInfo($theme);
576
- }
577
-
578
- input[type="radio"]:checked {
579
- border-color: getInfo($theme);
580
- }
581
-
582
- input[type="radio"]:checked::after {
583
- background-color: getInfo($theme);
584
- }
585
-
586
- .matcha-radio-container:hover {
587
- background-color: rgba(getInfo($theme), 0.1);
588
- }
69
+ &::after { background-color: transparent; }
70
+ }
71
+ }
589
72
 
590
- .matcha-radio-container .ripple {
591
- background: rgba(getInfoContrast($theme), 0.2) !important;
73
+ .matcha-radio-container {
74
+ &:hover { background-color: rgba(call(#{$colorFn}, $theme), 0.1); }
75
+ .ripple { background: rgba(call(#{$colorFn}Contrast, $theme), 0.2) !important; }
76
+ }
592
77
  }
593
78
  }
594
79
 
595
80
  // disabled
596
81
  &[disabled] {
597
82
  input[type="radio"] {
598
- border-color: getGrey($theme);
83
+ box-shadow: 0px 0px 0px 2px getGrey($theme) inset;
84
+
85
+ &:checked {
86
+ box-shadow: 0px 0px 0px 2px getGrey($theme) inset,
87
+ 0px 0px 0px 5px getSurface($theme) inset,
88
+ 0px 0px 0px 10px getGrey($theme) inset;
89
+
90
+ &::after { background-color: transparent; }
91
+ }
599
92
  }
600
93
  }
601
94
 
@@ -619,27 +112,16 @@ matcha-radio {
619
112
  padding: 0;
620
113
  margin: 0;
621
114
  border-radius: 50%;
622
- border-width: 2px;
115
+ border-width: 0;
623
116
  border-style: solid;
624
117
  outline: none;
625
118
  cursor: pointer;
626
119
  position: relative;
627
120
  transition: all 0.2s ease;
628
121
 
629
- &:checked {
630
- &::after {
631
- content: '';
632
- position: absolute;
633
- left: 3px;
634
- top: 3px;
635
- width: 8px;
636
- height: 8px;
637
- border-radius: 50%;
638
- }
639
- }
640
-
641
122
  &:disabled {
642
123
  cursor: not-allowed;
124
+ transition: none;
643
125
  }
644
126
 
645
127
  &:focus {}
@@ -655,11 +137,6 @@ matcha-radio {
655
137
  cursor: not-allowed;
656
138
  opacity: 0.6;
657
139
 
658
- input[type="radio"] {
659
- border-width: 2px;
660
- border-style: solid;
661
- }
662
-
663
140
  .matcha-radio-label {
664
141
  cursor: not-allowed;
665
142
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "matcha-theme",
3
- "version": "20.270.0",
3
+ "version": "20.271.0",
4
4
  "description": "Themes for matcha-design-system",
5
5
  "main": "main.scss",
6
6
  "scripts": {