Skip to content

fix(form-field): select value text blending in with the background in high contrast mode #15286

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
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
11 changes: 11 additions & 0 deletions src/lib/form-field/form-field-input.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@import '../core/style/variables';
@import '../core/style/vendor-prefixes';
@import '../../cdk/a11y/a11y';

// The Input element proper.
.mat-input-element {
Expand Down Expand Up @@ -175,6 +176,16 @@ select.mat-input-element {
// We need to reset the `color` as well, because IE sets it to white.
color: inherit;
background: none;

// IE and Edge in high contrast mode reset the color for a focused select to the same color
// as the background, however this causes it blend in because we've reset the `background`
// above. We have to add a more specific selector in order to ensure that it gets the
// `color` from our theme instead.
@include cdk-high-contrast {
.mat-focused & {
color: inherit;
}
}
}
}

Expand Down