Skip to content

Commit 8e975ee

Browse files
crisbetojelbourn
authored andcommitted
fix(material-experimental/button): buttons not outlined in high contrast mode (#16410)
Fixes the MDC-based buttons blending in with the background in high contrast mode. In general MDC doesn't include high contrast styling, whereas our current components do.
1 parent 0a4b518 commit 8e975ee

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/material-experimental/mdc-button/button.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@import '@material/button/mixins';
22
@import '../mdc-helpers/mdc-helpers';
3+
@import '../../cdk/a11y/a11y';
34

45
@include mdc-button-without-ripple($query: $mat-base-styles-query);
56

@@ -12,4 +13,12 @@ $_mat-button-ripple-opacity: 0.1;
1213
opacity: $_mat-button-ripple-opacity;
1314
background-color: currentColor;
1415
}
16+
17+
// Add an outline to make buttons more visible in high contrast mode. Stroked buttons
18+
// don't need a special look in high-contrast mode, because those already have an outline.
19+
@include cdk-high-contrast {
20+
&:not(.mdc-button--outlined) {
21+
outline: solid 1px;
22+
}
23+
}
1524
}

0 commit comments

Comments
 (0)