Skip to content

fix(button): focus indication hard to see in high contrast mode #13259

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
10 changes: 8 additions & 2 deletions src/lib/button/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@
// Element that overlays the button to show focus and hover effects.
.mat-button-focus-overlay {
opacity: 0;

transition: $mat-button-focus-transition;

._mat-animation-noopable & {
Expand All @@ -120,7 +119,14 @@
// Note that IE will render this in the same way, no
// matter whether the theme is light or dark. This helps
// with the readability of focused buttons.
background-color: rgba(white, 0.5);
background-color: #fff;
}

@include cdk-high-contrast(black-on-white) {
// For the black-on-white high contrast mode, the browser will set this element
// to white, making it blend in with the background, hence why we need to set
// it explicitly to black.
background-color: #000;
}
}

Expand Down