Skip to content

Commit f6aa10e

Browse files
committed
fix(material-experimental/mdc-select): arrow not rendering in high contrast mode
The MDC select uses a CSS triangle for its down arrow which renders as a rectangle in high contrast mode. These changes switch it to an SVG arrow. These changes are identical to angular#14219 which had some trouble landing due to screenshot diffs. The MDC select shouldn't have such issues. Relates to angular#21263.
1 parent 73d570a commit f6aa10e

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

src/material-experimental/mdc-select/select.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@
2121
</span>
2222
</div>
2323

24-
<div class="mat-mdc-select-arrow-wrapper"><div class="mat-mdc-select-arrow"></div></div>
24+
<div class="mat-mdc-select-arrow-wrapper">
25+
<div class="mat-mdc-select-arrow">
26+
<!-- Use an inline SVG, because it works better than a CSS triangle in high contrast mode. -->
27+
<svg viewBox="0 0 24 24" width="24px" height="24px" focusable="false">
28+
<path d="M7 10l5 5 5-5z"/>
29+
</svg>
30+
</div>
31+
</div>
2532
</div>
2633

2734
<ng-template

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,18 @@ $scale: 0.75 !default;
6060
}
6161

6262
.mat-mdc-select-arrow {
63-
width: 0;
64-
height: 0;
65-
border-left: $mat-select-arrow-size solid transparent;
66-
border-right: $mat-select-arrow-size solid transparent;
67-
border-top: $mat-select-arrow-size solid;
6863
margin: 0 $mat-select-arrow-margin;
64+
width: $mat-select-arrow-size * 2;
65+
height: $mat-select-arrow-size;
66+
position: relative;
67+
68+
svg {
69+
fill: currentColor;
70+
position: absolute;
71+
top: 50%;
72+
left: 50%;
73+
transform: translate(-50%, -50%);
74+
}
6975
}
7076

7177
// Note that the `.mdc-menu-surface` is here in order to bump up the specificity

0 commit comments

Comments
 (0)