Skip to content

Commit

Permalink
fix(material/datepicker): unable to distinguish disabled calendar cel…
Browse files Browse the repository at this point in the history
…ls in high contrast mode (#21399)

Fixes that users in high contrast mode aren't able to distinguish between enabled and
disabled calendar cells.

(cherry picked from commit 791af82)
  • Loading branch information
crisbeto authored and annieyw committed Jan 9, 2021
1 parent 9c6dfd6 commit 748072d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/material/datepicker/calendar-body.scss
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ $mat-calendar-range-end-body-cell-size:

.mat-calendar-body-disabled {
cursor: default;

// Fade out the disabled cells so that they can be distinguished from the enabled ones. Note that
// ideally we'd use `color: GreyText` here which is what the browser uses for disabled buttons,
// but we can't because Firefox doesn't recognize it.
@include cdk-high-contrast(active, off) {
opacity: 0.5;
}
}

.mat-calendar-body-cell-content {
Expand Down

0 comments on commit 748072d

Please sign in to comment.