Skip to content

Commit 1080a1a

Browse files
committed
fix(material/badge): remove badge opacity color mix
1 parent eb9abc3 commit 1080a1a

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

src/material/badge/_m2-badge.scss

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,8 @@ $_large-size: $_default-size + 6px;
4242
// Tokens that can be configured through Angular Material's color theming API.
4343
@function get-color-tokens($theme) {
4444
$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-
5945
@return map.merge($primary-color-tokens, (
60-
badge-disabled-state-background-color: $disabled-background,
46+
badge-disabled-state-background-color: inspection.get-theme-color($theme, foreground, disabled-button),
6147
badge-disabled-state-text-color: inspection.get-theme-color($theme, foreground, disabled-text),
6248
));
6349
}

0 commit comments

Comments
 (0)