Skip to content

fix(cdk/a11y): account for Windows 11 high contrast themes in detector #25624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,16 @@ export class HighContrastModeDetector implements OnDestroy {
testElement.remove();

switch (computedColor) {
// Pre Windows 11 dark theme.
case 'rgb(0,0,0)':
// Windows 11 dark themes.
case 'rgb(45,50,54)':
case 'rgb(32,32,32)':
return HighContrastMode.WHITE_ON_BLACK;
// Pre Windows 11 light theme.
case 'rgb(255,255,255)':
// Windows 11 light theme.
case 'rgb(255,250,239)':
return HighContrastMode.BLACK_ON_WHITE;
}
return HighContrastMode.NONE;
Expand Down