Skip to content

Commit 411e3be

Browse files
author
Andrew Seguin
committed
fix(material/chips): update tokens to system colors
1 parent eba4719 commit 411e3be

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed

src/material/chips/_m2-chip.scss

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,38 +40,24 @@
4040
// Tokens that can be configured through Angular Material's color theming API.
4141
@function get-color-tokens($theme, $color-variant: null) {
4242
$system: m2-utils.get-system($theme);
43-
$foreground: null;
44-
$background: null;
45-
$state-layer-color: inspection.get-theme-color($theme, foreground, base);
43+
$background: m3-utils.color-with-opacity(map.get($system, on-surface), 12%);
44+
$foreground: map.get($system, on-surface);
4645

47-
@if $color-variant == null {
48-
$is-dark: inspection.get-theme-type($theme) == dark;
49-
$grey-50: map.get(m2-palette.$grey-palette, 50);
50-
$grey-900: map.get(m2-palette.$grey-palette, 900);
51-
$foreground: if($is-dark, $grey-50, $grey-900);
52-
53-
$surface: map.get($system, surface);
54-
$background: if(
55-
meta.type-of($state-layer-color) == color and meta.type-of($surface) == color,
56-
color.mix($state-layer-color, $surface, 12%),
57-
$state-layer-color
58-
);
59-
}
60-
@else {
46+
@if $color-variant {
6147
$system: m3-utils.replace-colors-with-variant($system, primary, $color-variant);
62-
6348
$background: map.get($system, primary);
6449
$foreground: map.get($system, on-primary);
6550
}
51+
6652
@return (
6753
chip-disabled-label-text-color: $foreground,
6854
chip-elevated-container-color: $background,
6955
chip-elevated-disabled-container-color: $background,
7056
chip-elevated-selected-container-color: $background,
7157
chip-flat-disabled-selected-container-color: $background,
72-
chip-focus-state-layer-color: $state-layer-color,
58+
chip-focus-state-layer-color: map.get($system, on-surface),
7359
chip-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
74-
chip-hover-state-layer-color: $state-layer-color,
60+
chip-hover-state-layer-color: map.get($system, on-surface),
7561
chip-label-text-color: $foreground,
7662
chip-selected-disabled-trailing-icon-color: $foreground,
7763
chip-selected-focus-state-layer-color: map.get($system, focus-state-layer-opacity),

0 commit comments

Comments
 (0)