|
1 | | -@use 'sass:meta'; |
2 | 1 | @use 'sass:map'; |
3 | 2 | @use 'sass:math'; |
4 | | -@use 'sass:color'; |
5 | 3 | @use '../core/theming/inspection'; |
6 | 4 |
|
7 | 5 | $_default-size: 22px; |
@@ -42,22 +40,9 @@ $_large-size: $_default-size + 6px; |
42 | 40 | // Tokens that can be configured through Angular Material's color theming API. |
43 | 41 | @function get-color-tokens($theme) { |
44 | 42 | $primary-color-tokens: private-get-color-palette-color-tokens($theme, primary); |
45 | | - $app-background: inspection.get-theme-color($theme, background, background); |
46 | | - $disabled-background: inspection.get-theme-color($theme, foreground, disabled-button); |
47 | | - |
48 | | - // The disabled color usually has some kind of opacity, but because the badge is overlayed |
49 | | - // on top of something else, it won't look good if it's opaque. If it is a color *type*, |
50 | | - // we convert it into a solid color by taking the opacity from the rgba value and using |
51 | | - // the value to determine the percentage of the background to put into foreground when |
52 | | - // mixing the colors together. |
53 | | - @if (meta.type-of($disabled-background) == color and meta.type-of($app-background) == color) { |
54 | | - $badge-opacity: color.opacity($disabled-background); |
55 | | - $disabled-background: color.mix($app-background, |
56 | | - rgba($disabled-background, 1), (1 - $badge-opacity) * 100%); |
57 | | - } |
58 | | - |
59 | 43 | @return map.merge($primary-color-tokens, ( |
60 | | - badge-disabled-state-background-color: $disabled-background, |
| 44 | + badge-disabled-state-background-color: |
| 45 | + inspection.get-theme-color($theme, foreground, disabled-button), |
61 | 46 | badge-disabled-state-text-color: inspection.get-theme-color($theme, foreground, disabled-text), |
62 | 47 | )); |
63 | 48 | } |
|
0 commit comments