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/select): arrow not rendering correctly in high contrast mode #14219

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/material/select/select.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@
</span>
</div>

<div class="mat-select-arrow-wrapper"><div class="mat-select-arrow"></div></div>
<div class="mat-select-arrow-wrapper">
<!-- Use an inline SVG, because it works better than a CSS triangle in high contrast mode -->
<div class="mat-select-arrow">
<svg viewBox="0 0 24 24" width="24px" height="24px" focusable="false">
<path d="M7 10l5 5 5-5z"/>
</svg>
</div>
</div>
</div>

<ng-template
Expand Down
19 changes: 14 additions & 5 deletions src/material/select/select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,21 @@ $mat-select-placeholder-arrow-space: 2 * ($mat-select-arrow-size + $mat-select-a
}

.mat-select-arrow {
width: 0;
height: 0;
border-left: $mat-select-arrow-size solid transparent;
border-right: $mat-select-arrow-size solid transparent;
border-top: $mat-select-arrow-size solid;
margin: 0 $mat-select-arrow-margin;
width: $mat-select-arrow-size * 2;
height: $mat-select-arrow-size;
position: relative;

svg {
fill: currentColor;
position: absolute;

// Note that we use specific values here in order to position the arrow exactly
// where the old one used to be and to avoid screenshot diff failures.
top: 2.5px;
left: 5px;
transform: translate(-50%, -50%);
}
}

.mat-select-panel-wrap {
Expand Down