Skip to content
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

fix(material-experimental/mdc-slide-toggle): increase contrast in high contrast mode #22945

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 10 additions & 7 deletions src/material-experimental/mdc-slide-toggle/slide-toggle.scss
Expand Up @@ -83,12 +83,15 @@


@include a11y.high-contrast(active, off) {
.mat-mdc-slide-toggle-focused {
.mdc-switch__track {
// Usually 1px would be enough, but MDC reduces the opacity on the
// element so we need to make this a bit more prominent.
outline: solid 2px;
outline-offset: private.private-div(mdc-switch.$track-height, 2);
}
// Bump the opacity on the disable slide toggle to make it easier to see.
.mat-mdc-slide-toggle .mdc-switch--disabled {
opacity: 0.75;
}

.mat-mdc-slide-toggle-focused .mdc-switch__track {
// Usually 1px would be enough, but MDC reduces the opacity on the
// element so we need to make this a bit more prominent.
outline: solid 2px;
outline-offset: private.private-div(mdc-switch.$track-height, 2);
}
}