Skip to content

Commit e650efa

Browse files
committed
fix(material/stepper): ensure sufficient contrast of step icon
1 parent 1f94f09 commit e650efa

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/material/core/m2/_palette.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,7 @@ $light-theme-background-palette: (
688688
unselected-chip: map.get($grey-palette, 300),
689689
disabled-list-option: map.get($grey-palette, 200),
690690
tooltip: map.get($grey-palette, 700),
691+
stepper-icon: $dark-secondary-text,
691692
);
692693

693694
// Background palette for dark themes.
@@ -707,6 +708,7 @@ $dark-theme-background-palette: (
707708
unselected-chip: map.get($grey-palette, 700),
708709
disabled-list-option: rgba(white, 0.12),
709710
tooltip: map.get($grey-palette, 700),
711+
stepper-icon: $light-secondary-text,
710712
);
711713

712714
// Foreground palette for light themes.
@@ -726,6 +728,7 @@ $light-theme-foreground-palette: (
726728
slider-min: rgba(black, 0.87),
727729
slider-off: rgba(black, 0.26),
728730
slider-off-active: rgba(black, 0.38),
731+
stepper-icon: white,
729732
);
730733

731734
// Foreground palette for dark themes.
@@ -745,4 +748,5 @@ $dark-theme-foreground-palette: (
745748
slider-min: white,
746749
slider-off: rgba(white, 0.3),
747750
slider-off-active: rgba(white, 0.3),
751+
stepper-icon: black,
748752
);

src/material/core/tokens/m2/mat/_stepper.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ $prefix: (mat, stepper);
3838
header-selected-state-label-text-color: inspection.get-theme-color($theme, foreground, text),
3939
// Color of the header text when a step is in an error state.
4040
header-error-state-label-text-color: inspection.get-theme-color($theme, warn, text),
41+
// Foreground color of the header icon.
42+
header-icon-foreground-color: inspection.get-theme-color($theme, foreground, stepper-icon),
4143
// Background color of the header icon.
42-
header-icon-background-color: inspection.get-theme-color($theme, foreground, secondary-text),
44+
header-icon-background-color: inspection.get-theme-color($theme, background, stepper-icon),
4345
// Foreground color of the header icon in the error state.
4446
header-error-state-icon-foreground-color: inspection.get-theme-color($theme, warn, text),
4547
// Background color of the header icon in the error state.
@@ -91,8 +93,6 @@ $prefix: (mat, stepper);
9193
$active-state-background: inspection.get-theme-color($theme, $palette-name);
9294

9395
@return (
94-
// Foreground color of the header icon.
95-
header-icon-foreground-color: $active-state-foreground,
9696
// Background color of the header icon in the selected state.
9797
header-selected-state-icon-background-color: $active-state-background,
9898
// Foreground color of the header icon in the selected state.

0 commit comments

Comments
 (0)