Skip to content

Commit d9cc055

Browse files
authored
fix(material/datepicker): screen reader close button style specificity too low (#21058)
The specificity of the screen reader close button was the same as `.mat-raised-button` which means that if the button styles are loaded after the datepicker styles, they'll be overridden and will make the button look weird. These changes bump up the specificity a bit to work around the issue. Fixes #21043.
1 parent e9323b9 commit d9cc055

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/material/datepicker/datepicker-content.scss

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ $mat-datepicker-touch-max-height: 788px;
2929
width: $mat-datepicker-non-touch-calendar-width;
3030
height: $mat-datepicker-non-touch-calendar-height;
3131
}
32+
33+
// Note that this selector doesn't technically have to be nested, but we want the slightly
34+
// higher specificity, or it can be overridden based on the CSS insertion order (see #21043).
35+
.mat-datepicker-close-button {
36+
position: absolute;
37+
top: 100%;
38+
left: 0;
39+
margin-top: 8px;
40+
}
3241
}
3342

3443
.mat-datepicker-content-touch {
@@ -49,13 +58,6 @@ $mat-datepicker-touch-max-height: 788px;
4958
}
5059
}
5160

52-
.mat-datepicker-close-button {
53-
position: absolute;
54-
top: 100%;
55-
left: 0;
56-
margin-top: 8px;
57-
}
58-
5961
@media all and (orientation: landscape) {
6062
.mat-datepicker-content-touch .mat-calendar {
6163
width: $mat-datepicker-touch-landscape-width;

0 commit comments

Comments
 (0)