Skip to content

Commit 7cc42f5

Browse files
crisbetoandrewseguin
authored andcommitted
fix(material/datepicker): range picker placeholders not hidden in high contrast mode
Fixes that the placeholders were showing up behind the label in high contrast mode.
1 parent 635ee67 commit 7cc42f5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/material/datepicker/date-range-input.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@use '../core/style/variables';
22
@use '../core/style/vendor-prefixes';
3+
@use '../../cdk/a11y';
34

45
$date-range-input-separator-spacing: 4px;
56
$date-range-input-part-max-width: calc(50% - #{$date-range-input-separator-spacing});
@@ -80,6 +81,12 @@ $date-range-input-part-max-width: calc(50% - #{$date-range-input-separator-spaci
8081
color: transparent !important;
8182
-webkit-text-fill-color: transparent;
8283
transition: none;
84+
85+
@include a11y.high-contrast(active, off) {
86+
// In high contrast mode the browser will render the
87+
// placeholder despite the `color: transparent` above.
88+
opacity: 0;
89+
}
8390
}
8491
}
8592
}

0 commit comments

Comments
 (0)