Skip to content

Commit 92a8253

Browse files
authored
fix(material/badge): use system disabled states (#31266)
1 parent ecc6a09 commit 92a8253

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/material/badge/_m2-badge.scss

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
@use 'sass:map';
22
@use 'sass:math';
33
@use '../core/theming/inspection';
4+
@use '../core/tokens/m2-utils';
5+
@use '../core/tokens/m3-utils';
46

57
$_default-size: 22px;
68
$_small-size: $_default-size - 6px;
@@ -39,11 +41,13 @@ $_large-size: $_default-size + 6px;
3941

4042
// Tokens that can be configured through Angular Material's color theming API.
4143
@function get-color-tokens($theme) {
44+
$system: m2-utils.get-system($theme);
45+
$disabled: m3-utils.color-with-opacity(map.get($system, on-surface), 38%);
46+
$disabled-container : m3-utils.color-with-opacity(map.get($system, on-surface), 12%);
4247
$primary-color-tokens: private-get-color-palette-color-tokens($theme, primary);
4348
@return map.merge($primary-color-tokens, (
44-
badge-disabled-state-background-color:
45-
inspection.get-theme-color($theme, foreground, disabled-button),
46-
badge-disabled-state-text-color: inspection.get-theme-color($theme, foreground, disabled-text),
49+
badge-disabled-state-background-color: $disabled-container,
50+
badge-disabled-state-text-color: $disabled,
4751
));
4852
}
4953

0 commit comments

Comments
 (0)