Skip to content

Commit

Permalink
fix(material/datepicker): screen reader close button style specificit…
Browse files Browse the repository at this point in the history
…y too low

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 angular#21043.
  • Loading branch information
crisbeto committed Nov 16, 2020
1 parent 94bd0d4 commit 230ad0d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/material/datepicker/datepicker-content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ $mat-datepicker-touch-max-height: 788px;
width: $mat-datepicker-non-touch-calendar-width;
height: $mat-datepicker-non-touch-calendar-height;
}

// Note that this selector doesn't technically have to be nested, but we want the slightly
// higher specificity, or it can be overridden based on the CSS insertion order (see #21043).
.mat-datepicker-close-button {
position: absolute;
top: 100%;
left: 0;
margin-top: 8px;
}
}

.mat-datepicker-content-touch {
Expand All @@ -49,13 +58,6 @@ $mat-datepicker-touch-max-height: 788px;
}
}

.mat-datepicker-close-button {
position: absolute;
top: 100%;
left: 0;
margin-top: 8px;
}

@media all and (orientation: landscape) {
.mat-datepicker-content-touch .mat-calendar {
width: $mat-datepicker-touch-landscape-width;
Expand Down

0 comments on commit 230ad0d

Please sign in to comment.