Skip to content

fix(datepicker): make touch UI calendar use 80% of width in portrait mode #5943

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 27, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions src/lib/datepicker/datepicker-content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ $md-datepicker-non-touch-calendar-height: 354px;
// the calendar grows, since some of the elements have pixel-based sizes. These numbers have been
// chosen to minimize extra whitespace at larger sizes, while still ensuring we won't need
// scrollbars at smaller sizes.
$md-datepicker-touch-width: 64vmin;
$md-datepicker-touch-height: 80vmin;
$md-datepicker-touch-landscape-width: 64vh;
$md-datepicker-touch-landscape-height: 80vh;
$md-datepicker-touch-portrait-width: 80vw;
$md-datepicker-touch-portrait-height: 100vw;
$md-datepicker-touch-min-width: 250px;
$md-datepicker-touch-min-height: 312px;
$md-datepicker-touch-max-width: 750px;
Expand Down Expand Up @@ -46,11 +48,23 @@ $md-datepicker-touch-max-height: 788px;
margin: -24px;

.mat-calendar {
width: $md-datepicker-touch-width;
height: $md-datepicker-touch-height;
min-width: $md-datepicker-touch-min-width;
min-height: $md-datepicker-touch-min-height;
max-width: $md-datepicker-touch-max-width;
max-height: $md-datepicker-touch-max-height;
}
}

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

@media all and (orientation: portrait) {
.mat-datepicker-content-touch .mat-calendar {
width: $md-datepicker-touch-portrait-width;
height: $md-datepicker-touch-portrait-height;
}
}