From 9e35c64975551d3fd494779949bf74d37faa7b84 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Mon, 4 Mar 2024 07:23:28 +0100 Subject: [PATCH] fix(material/chips): derive surface color from palette Fixes a hardcoded color in the chips tokens. --- src/material/core/tokens/m2/mdc/_chip.scss | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/material/core/tokens/m2/mdc/_chip.scss b/src/material/core/tokens/m2/mdc/_chip.scss index 5a6a78304752..5bf61d142b95 100644 --- a/src/material/core/tokens/m2/mdc/_chip.scss +++ b/src/material/core/tokens/m2/mdc/_chip.scss @@ -2,7 +2,6 @@ @use 'sass:map'; @use 'sass:meta'; @use '../../token-utils'; -@use '../../../mdc-helpers/mdc-helpers'; @use '../../../style/sass-utils'; @use '../../../theming/theming'; @use '../../../theming/inspection'; @@ -230,15 +229,10 @@ $prefix: (mdc, chip); $foreground: if($is-dark, $grey-50, $grey-900); $surface: inspection.get-theme-color($theme, background, card); - $on-surface: if( - mdc-helpers.variable-safe-contrast-tone($surface, $is-dark) == 'dark', - #000, - #fff - ); $background: if( - meta.type-of($on-surface) == color and meta.type-of($surface) == color, - color.mix($on-surface, $surface, 12%), - $on-surface + meta.type-of($state-layer-color) == color and meta.type-of($surface) == color, + color.mix($state-layer-color, $surface, 12%), + $state-layer-color ); } @else {