|
| 1 | +@use '../../styles/colors.scss'; |
| 2 | +@use '../../styles/lengths.scss'; |
| 3 | +@use '../../styles/typography.scss'; |
| 4 | + |
| 5 | +$badge-colors-secondary-color: theme('badge-colors-secondary-color', colors.foreground(primary)); |
| 6 | +$badge-colors-secondary-background-color: theme('badge-colors-secondary-background-color', colors.primary(100)); |
| 7 | + |
| 8 | +$badge-colors-primary-color: theme('badge-colors-primary-color', colors.foreground(alternative)); |
| 9 | +$badge-colors-primary-background-color: theme('badge-colors-primary-background-color', colors.primary(500)); |
| 10 | + |
| 11 | +$badge-colors-danger-color: theme('badge-colors-danger-color', colors.foreground(alternative)); |
| 12 | +$badge-colors-danger-background-color: theme('badge-colors-danger-background-color', colors.danger(500)); |
| 13 | + |
| 14 | +$badge-colors-ghost-color: theme('badge-colors-ghost-color', colors.foreground(alternative)); |
| 15 | +$badge-colors-ghost-background-color: theme('badge-colors-ghost-background-color', colors.neutral(700)); |
| 16 | + |
| 17 | +$badge-colors-warning-color: theme('badge-colors-warning-color', colors.foreground(alternative)); |
| 18 | +$badge-colors-warning-background-color: theme('badge-colors-warning-background-color', colors.warning-alternative(500)); |
| 19 | + |
| 20 | +$badge-colors-disabled-color: theme('badge-colors-disabled-color', colors.foreground(hint)); |
| 21 | +$badge-colors-disabled-background-color: theme('badge-colors-disabled-background-color', colors.neutral(400)); |
| 22 | + |
| 23 | +.rcx-badge { |
| 24 | + display: flex; |
| 25 | + overflow: hidden; |
| 26 | + |
| 27 | + width: fit-content; |
| 28 | + min-width: lengths.size(16); |
| 29 | + |
| 30 | + padding: |
| 31 | + lengths.padding(2) |
| 32 | + lengths.padding(4); |
| 33 | + |
| 34 | + text-align: center; |
| 35 | + |
| 36 | + white-space: nowrap; |
| 37 | + |
| 38 | + text-decoration: none; |
| 39 | + text-overflow: ellipsis; |
| 40 | + |
| 41 | + word-break: keep-all; |
| 42 | + |
| 43 | + border-radius: lengths.border-radius(full); |
| 44 | + |
| 45 | + @include typography.use-font-scale(micro); |
| 46 | + |
| 47 | + &--secondary { |
| 48 | + color: $badge-colors-secondary-color; |
| 49 | + background-color: $badge-colors-secondary-background-color; |
| 50 | + } |
| 51 | + |
| 52 | + &--primary { |
| 53 | + color: $badge-colors-primary-color; |
| 54 | + background-color: $badge-colors-primary-background-color; |
| 55 | + } |
| 56 | + |
| 57 | + &--danger { |
| 58 | + color: $badge-colors-danger-color; |
| 59 | + background-color: $badge-colors-danger-background-color; |
| 60 | + } |
| 61 | + |
| 62 | + &--warning { |
| 63 | + color: $badge-colors-warning-color; |
| 64 | + background-color: $badge-colors-warning-background-color; |
| 65 | + } |
| 66 | + |
| 67 | + &--ghost { |
| 68 | + color: $badge-colors-ghost-color; |
| 69 | + background-color: $badge-colors-ghost-background-color; |
| 70 | + } |
| 71 | + |
| 72 | + &--disabled { |
| 73 | + color: $badge-colors-disabled-color; |
| 74 | + background-color: $badge-colors-disabled-background-color; |
| 75 | + } |
| 76 | +} |
0 commit comments