Skip to content

Commit d112acb

Browse files
crisbetoamysorto
authored andcommitted
fix(material-experimental/mdc-select): resolve a couple of visual issues 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)
1 parent afa9431 commit d112acb

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ $scale: 0.75 !default;
7272
top: 50%;
7373
left: 50%;
7474
transform: translate(-50%, -50%);
75+
76+
@include a11y.high-contrast(active, off) {
77+
// On Chromium browsers the `currentColor` blends in with the
78+
// background for SVGs so we have to fall back to `CanvasText`.
79+
fill: CanvasText;
80+
}
7581
}
7682
}
7783

@@ -159,4 +165,8 @@ $scale: 0.75 !default;
159165
content: ' ';
160166
white-space: pre;
161167
width: 1px;
168+
169+
// Prevents some browsers from rendering the element in high contrast mode.
170+
display: inline-block;
171+
opacity: 0;
162172
}

src/material/select/select.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,8 @@ $placeholder-arrow-space: 2 * ($arrow-size + $arrow-margin);
158158
content: ' ';
159159
white-space: pre;
160160
width: 1px;
161+
162+
// Prevents some browsers from rendering the element in high contrast mode.
163+
display: inline-block;
164+
opacity: 0;
161165
}

0 commit comments

Comments
 (0)