Skip to content

Commit 56840c3

Browse files
crisbetoannieyw
authored andcommitted
fix(material/datepicker): toggle icon not visible in high contrast mode on Chromium browsers (#22352)
Fixes an issue where the datepicker toggle icon blends in with the background in high contrast mode on Chromium-based browsers (Edge and Chrome). (cherry picked from commit ea5e5e0)
1 parent 14ec1a3 commit 56840c3

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/material/datepicker/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ sass_binary(
6060
sass_binary(
6161
name = "datepicker_toggle_scss",
6262
src = "datepicker-toggle.scss",
63+
deps = ["//src/cdk/a11y:a11y_scss_lib"],
6364
)
6465

6566
sass_binary(

src/material/datepicker/datepicker-toggle.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use '../../cdk/a11y/a11y';
2+
13
.mat-form-field-appearance-legacy {
24
.mat-form-field-prefix,
35
.mat-form-field-suffix {
@@ -21,3 +23,11 @@
2123
}
2224
}
2325
}
26+
27+
@include a11y.high-contrast(active, off) {
28+
.mat-datepicker-toggle-default-icon {
29+
// On Chromium-based browsers the icon doesn't appear to inherit the text color in high
30+
// contrast mode so we have to set it explicitly. This is a no-op on IE and Firefox.
31+
color: CanvasText;
32+
}
33+
}

0 commit comments

Comments
 (0)