Skip to content

Commit

Permalink
fix(material-experimental/mdc-button): high contrast outline for soli…
Browse files Browse the repository at this point in the history
…tary

icon-buttons

The high-contrast style for all buttons was previously defined in
`button.scss`, but icon-buttons load `icon-button.scss`. This means that
the high contrast style for icon buttons was only loaded when another
type of button was on the page. This change moved the icon-button high-contrast
style to `icon-button.scss`.
  • Loading branch information
jelbourn committed Jun 16, 2021
1 parent 9428939 commit a06de2c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/material-experimental/mdc-button/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@
.mat-mdc-button:not(.mdc-button--outlined),
.mat-mdc-unelevated-button:not(.mdc-button--outlined),
.mat-mdc-raised-button:not(.mdc-button--outlined),
.mat-mdc-outlined-button:not(.mdc-button--outlined),
.mat-mdc-icon-button {
.mat-mdc-outlined-button:not(.mdc-button--outlined) {
@include a11y.high-contrast(active, off) {
outline: solid 1px;
}
Expand Down
5 changes: 5 additions & 0 deletions src/material-experimental/mdc-button/icon-button.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@use '@material/icon-button' as mdc-icon-button;
@use '../mdc-helpers/mdc-helpers';
@use 'button-base';
@use '../../cdk/a11y';

@include mdc-icon-button.without-ripple($query: mdc-helpers.$mat-base-styles-query);

Expand All @@ -26,4 +27,8 @@
opacity: 1;
}
}

@include a11y.high-contrast(active, off) {
outline: solid 1px;
}
}

0 comments on commit a06de2c

Please sign in to comment.