|
2 | 2 | @use 'styles/utilities' as *; |
3 | 3 |
|
4 | 4 | :host { |
5 | | - --size: #{rem(22px)}; |
6 | | - --_badge-size: var(--size); |
7 | | - |
8 | 5 | width: fit-content; |
9 | 6 | height: fit-content; |
10 | 7 | display: inline-flex; |
11 | | - font-weight: 500; |
12 | 8 | vertical-align: top; |
13 | 9 | } |
14 | 10 |
|
15 | | -[part='base'] { |
16 | | - @include type-style('caption'); |
17 | | - |
| 11 | +[part~='base'] { |
18 | 12 | display: inline-flex; |
19 | | - min-width: var(--size); |
20 | | - min-height: var(--size); |
| 13 | + min-width: var(--_badge-size); |
| 14 | + min-height: var(--_badge-size); |
21 | 15 | justify-content: center; |
22 | 16 | align-items: center; |
23 | 17 | overflow: hidden; |
24 | 18 | white-space: nowrap; |
| 19 | + font-size: sizable(var(--ig-caption-font-size), var(--ig-body-2-font-size), var(--ig-body-2-font-size)); |
| 20 | + font-weight: sizable(var(--ig-caption-font-weight), var(--ig-body-2-font-weight), var(--ig-body-2-font-weight)); |
| 21 | + line-height: sizable(var(--ig-caption-line-height), var(--ig-body-2-line-height), var(--ig-body-2-line-height)); |
| 22 | + letter-spacing: sizable(var(--ig-caption-letter-spacing), var(--ig-body-2-letter-spacing), var(--ig-body-2-letter-spacing)); |
| 23 | + text-transform: sizable(var(--ig-caption-text-transform), var(--ig-body-2-text-transform), var(--ig-body-2-text-transform)); |
25 | 24 | } |
26 | 25 |
|
27 | | -::slotted(*) { |
28 | | - --size: calc(var(--_badge-size) / 2) !important; |
| 26 | +:host(:not(:empty, [dot])) [part='base'] { |
| 27 | + padding-inline: pad-inline(rem(4px), rem(6px), rem(8px)); |
29 | 28 | } |
30 | 29 |
|
31 | | -:host(:not(:empty)) [part='base'] { |
32 | | - padding-inline: rem(4px); |
33 | | -} |
34 | | - |
35 | | -:host([variant='info']) [part='base'] { |
| 30 | +:host([variant='info']) [part~='base'] { |
36 | 31 | background: color(info, 500); |
37 | 32 | } |
38 | 33 |
|
39 | | -:host([variant='success']) [part='base'] { |
| 34 | +:host([variant='success']) [part~='base'] { |
40 | 35 | background: color(success, 500); |
41 | 36 | } |
42 | 37 |
|
43 | | -:host([variant='warning']) [part='base'] { |
| 38 | +:host([variant='warning']) [part~='base'] { |
44 | 39 | background: color(warn, 500); |
| 40 | + color: contrast-color(warn, 500); |
| 41 | + |
| 42 | + igc-icon, |
| 43 | + ::slotted(igc-icon) { |
| 44 | + color: contrast-color(warn, 500); |
| 45 | + } |
45 | 46 | } |
46 | 47 |
|
47 | | -:host([variant='danger']) [part='base'] { |
| 48 | +:host([variant='danger']) [part~='base'] { |
48 | 49 | background: color(error, 500); |
| 50 | + color: contrast-color(error, 900); |
49 | 51 | } |
50 | 52 |
|
51 | 53 | :host([shape='rounded']), |
52 | | -:host([shape='rounded']) [part='base'] { |
53 | | - border-radius: calc(var(--size) * 2); |
| 54 | +:host([shape='rounded']) [part~='base'], |
| 55 | +:host([dot]) [part~='base'] { |
| 56 | + border-radius: calc(var(--_badge-size) * 2); |
54 | 57 | } |
0 commit comments