Skip to content

Commit

Permalink
fix(material-experimental/mdc-select): resolve a couple of visual iss…
Browse files Browse the repository at this point in the history
…ues in high contrast mode (#23007)

* Fixes that a small rectangle is rendered over the select placeholder text.
* Fixes that the dropdown arrow wasn't visible.

(cherry picked from commit babfb21)
  • Loading branch information
crisbeto authored and amysorto committed Jul 16, 2021
1 parent afa9431 commit d112acb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/material-experimental/mdc-select/select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ $scale: 0.75 !default;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);

@include a11y.high-contrast(active, off) {
// On Chromium browsers the `currentColor` blends in with the
// background for SVGs so we have to fall back to `CanvasText`.
fill: CanvasText;
}
}
}

Expand Down Expand Up @@ -159,4 +165,8 @@ $scale: 0.75 !default;
content: ' ';
white-space: pre;
width: 1px;

// Prevents some browsers from rendering the element in high contrast mode.
display: inline-block;
opacity: 0;
}
4 changes: 4 additions & 0 deletions src/material/select/select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,8 @@ $placeholder-arrow-space: 2 * ($arrow-size + $arrow-margin);
content: ' ';
white-space: pre;
width: 1px;

// Prevents some browsers from rendering the element in high contrast mode.
display: inline-block;
opacity: 0;
}

0 comments on commit d112acb

Please sign in to comment.