Skip to content

Commit

Permalink
fix(material-experimental/mdc-slide-toggle): missing focus indication…
Browse files Browse the repository at this point in the history
… in high contrast mode (#17471)

Fixes the MDC-based switch not having focus indication in high contrast mode.
  • Loading branch information
crisbeto authored and mmalerba committed Oct 24, 2019
1 parent ece8004 commit 3de0b08
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/material-experimental/mdc-slide-toggle/slide-toggle.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
@import '@material/switch/functions';
@import '@material/switch/mixins';
@import '@material/switch/variables';
@import '@material/form-field/mixins';
@import '@material/ripple/variables';
@import '../mdc-helpers/mdc-helpers';
@import '../../material/core/style/layout-common';
@import '../../cdk/a11y/a11y';

@include mdc-switch-without-ripple($query: $mat-base-styles-query);
@include mdc-form-field-core-styles($query: $mat-base-styles-query);
Expand Down Expand Up @@ -51,3 +53,15 @@
}
}
}


@include cdk-high-contrast {
.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: $mdc-switch-track-height / 2;
}
}
}

0 comments on commit 3de0b08

Please sign in to comment.