Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit b6e1098

Browse files
topherfangioRobert Messerle
authored andcommitted
feat(mdToolbar): Vary height depending upon device width/orientation.
On smaller screens, the toolbar now properly changes sizes according to the Material Specs. closes #2047 closes #4161
1 parent a12f940 commit b6e1098

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

src/components/toolbar/toolbar.scss

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
1+
// Standard/Desktop Heights
12
$toolbar-tools-height: 64px !default;
23
$toolbar-height: 64px !default;
34
$toolbar-medium-tall-height: 88px !default;
45
$toolbar-tall-height: 128px !default;
6+
7+
// Mobile portrait heights
8+
$toolbar-tools-height-mobile-portrait: 56px !default;
9+
$toolbar-height-mobile-portrait: 56px !default;
10+
11+
// Mobile landscape heights
12+
$toolbar-tools-height-mobile-landscape: 48px !default;
13+
$toolbar-height-mobile-landscape: 48px !default;
14+
15+
516
$toolbar-indent-margin: 64px !default;
617
$toolbar-padding: 16px !default;
718

@@ -18,6 +29,7 @@ md-toolbar {
1829
font-size: rem(2.0);
1930
min-height: $baseline-grid * 8;
2031
width: 100%;
32+
2133
&.md-whiteframe-z1-add, &.md-whiteframe-z1-remove {
2234
transition: box-shadow $swift-ease-in-out-duration linear;
2335
}
@@ -113,3 +125,31 @@ md-toolbar {
113125
border-bottom: 1px solid #fff;
114126
}
115127
}
128+
129+
// Handle mobile portrait
130+
@media only screen and (min-width: 0) and (max-width: $layout-breakpoint-sm) and
131+
(orientation: portrait) {
132+
md-toolbar {
133+
background: green;
134+
min-height: $toolbar-height-mobile-portrait;
135+
}
136+
137+
.md-toolbar-tools {
138+
height: $toolbar-height-mobile-portrait;
139+
max-height: $toolbar-height-mobile-portrait;
140+
}
141+
}
142+
143+
// Handle mobile landscape
144+
@media only screen and (min-width: 0) and (max-width: $layout-breakpoint-sm) and
145+
(orientation: landscape) {
146+
md-toolbar {
147+
min-height: $toolbar-height-mobile-landscape;
148+
}
149+
150+
.md-toolbar-tools {
151+
height: $toolbar-height-mobile-landscape;
152+
max-height: $toolbar-height-mobile-landscape;
153+
}
154+
}
155+

0 commit comments

Comments
 (0)