Skip to content

Commit 791af82

Browse files
authored
fix(material/datepicker): unable to distinguish disabled calendar cells in high contrast mode (#21399)
Fixes that users in high contrast mode aren't able to distinguish between enabled and disabled calendar cells.
1 parent bed1a6f commit 791af82

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/material/datepicker/calendar-body.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,13 @@ $mat-calendar-range-end-body-cell-size:
150150

151151
.mat-calendar-body-disabled {
152152
cursor: default;
153+
154+
// Fade out the disabled cells so that they can be distinguished from the enabled ones. Note that
155+
// ideally we'd use `color: GreyText` here which is what the browser uses for disabled buttons,
156+
// but we can't because Firefox doesn't recognize it.
157+
@include cdk-high-contrast(active, off) {
158+
opacity: 0.5;
159+
}
153160
}
154161

155162
.mat-calendar-body-cell-content {

0 commit comments

Comments
 (0)