Skip to content

Commit abc94c4

Browse files
authored
fix(progress-spinner): not respecting user colors in high contrast mode (#19786)
High contrast mode doesn't invert colors on SVG elements so we have to do it ourselves for the progress spinner. This ensures that the user's color settings are respected.
1 parent e32e2e2 commit abc94c4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/material/progress-spinner/progress-spinner.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@import '../core/style/variables';
22
@import '../core/style/noop-animation';
3+
@import '../../cdk/a11y/a11y';
34

45

56
// Animation config
@@ -27,6 +28,12 @@ $_mat-progress-spinner-default-circumference: $pi * $_mat-progress-spinner-defau
2728
fill: transparent;
2829
transform-origin: center;
2930
transition: stroke-dashoffset 225ms linear;
31+
32+
@include cdk-high-contrast(active, off) {
33+
// SVG colors aren't inverted automatically in high contrast mode. Set the
34+
// stroke to currentColor in order to respect the user's color settings.
35+
stroke: currentColor;
36+
}
3037
}
3138

3239
&.mat-progress-spinner-indeterminate-animation[mode='indeterminate'] {

0 commit comments

Comments
 (0)