Skip to content

Commit c294a3a

Browse files
authored
fix(cdk/a11y): account for Windows 11 high contrast themes in detector (#25624)
Windows 11 has different built in high contrast themes which weren't being picked up by the detector. Fixes #25580.
1 parent aab7c68 commit c294a3a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/cdk/a11y/high-contrast-mode/high-contrast-mode-detector.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,16 @@ export class HighContrastModeDetector implements OnDestroy {
9292
testElement.remove();
9393

9494
switch (computedColor) {
95+
// Pre Windows 11 dark theme.
9596
case 'rgb(0,0,0)':
97+
// Windows 11 dark themes.
98+
case 'rgb(45,50,54)':
99+
case 'rgb(32,32,32)':
96100
return HighContrastMode.WHITE_ON_BLACK;
101+
// Pre Windows 11 light theme.
97102
case 'rgb(255,255,255)':
103+
// Windows 11 light theme.
104+
case 'rgb(255,250,239)':
98105
return HighContrastMode.BLACK_ON_WHITE;
99106
}
100107
return HighContrastMode.NONE;

0 commit comments

Comments
 (0)