Skip to content

Commit 4d23b08

Browse files
crisbetommalerba
authored andcommitted
fix(datepicker): high contrast accessibility improvements (#10363)
Adds a few improvements to the datepicker calendar in high contrast mode: * Adds an outline around the calendar in popup, in order to make it stand out against the background. * Fixes all of the dates appearing as selected due to their border. * Adds an outline only around the selected date and a dotted outline against the current date.
1 parent ddb443a commit 4d23b08

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/lib/datepicker/calendar-body.scss

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@import '../../cdk/a11y/a11y';
2+
13
$mat-calendar-body-label-padding-start: 5% !default;
24
// We don't want the label to jump around when we switch between month and year views, so we use
35
// the same amount of padding regardless of the number of columns. We align the header label with
@@ -58,6 +60,22 @@ $mat-calendar-body-cell-content-size: 100% - $mat-calendar-body-cell-content-mar
5860

5961
// Choosing a value clearly larger than the height ensures we get the correct capsule shape.
6062
border-radius: 999px;
63+
64+
@include cdk-high-contrast {
65+
border: none;
66+
}
67+
}
68+
69+
70+
@include cdk-high-contrast {
71+
.mat-datepicker-popup,
72+
.mat-calendar-body-selected {
73+
outline: solid 1px;
74+
}
75+
76+
.mat-calendar-body-today {
77+
outline: dotted 1px;
78+
}
6179
}
6280

6381
[dir='rtl'] {

0 commit comments

Comments
 (0)