Skip to content

Commit ab6c713

Browse files
committed
fix(datepicker): make touch UI calendar use 80% of width in portrait
mode
1 parent 785f458 commit ab6c713

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

src/lib/datepicker/datepicker-content.scss

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ $md-datepicker-non-touch-calendar-height: 354px;
1414
// the calendar grows, since some of the elements have pixel-based sizes. These numbers have been
1515
// chosen to minimize extra whitespace at larger sizes, while still ensuring we won't need
1616
// scrollbars at smaller sizes.
17-
$md-datepicker-touch-width: 64vmin;
18-
$md-datepicker-touch-height: 80vmin;
17+
$md-datepicker-touch-landscape-width: 64vh;
18+
$md-datepicker-touch-landscape-height: 80vh;
19+
$md-datepicker-touch-portrait-width: 80vw;
20+
$md-datepicker-touch-portrait-height: 100vw;
1921
$md-datepicker-touch-min-width: 250px;
2022
$md-datepicker-touch-min-height: 312px;
2123
$md-datepicker-touch-max-width: 750px;
@@ -46,11 +48,23 @@ $md-datepicker-touch-max-height: 788px;
4648
margin: -24px;
4749

4850
.mat-calendar {
49-
width: $md-datepicker-touch-width;
50-
height: $md-datepicker-touch-height;
5151
min-width: $md-datepicker-touch-min-width;
5252
min-height: $md-datepicker-touch-min-height;
5353
max-width: $md-datepicker-touch-max-width;
5454
max-height: $md-datepicker-touch-max-height;
5555
}
5656
}
57+
58+
@media all and (orientation: landscape) {
59+
.mat-datepicker-content-touch .mat-calendar {
60+
width: $md-datepicker-touch-landscape-width;
61+
height: $md-datepicker-touch-landscape-height;
62+
}
63+
}
64+
65+
@media all and (orientation: portrait) {
66+
.mat-datepicker-content-touch .mat-calendar {
67+
width: $md-datepicker-touch-portrait-width;
68+
height: $md-datepicker-touch-portrait-height;
69+
}
70+
}

0 commit comments

Comments
 (0)