Skip to content

Commit

Permalink
feat(mdToolbar): Vary height depending upon device width/orientation.
Browse files Browse the repository at this point in the history
On smaller screens, the toolbar now properly changes sizes according
to the Material Specs.

closes angular#2047

closes angular#4161
  • Loading branch information
topherfangio authored and kennethcachia committed Sep 23, 2015
1 parent b4ee5a7 commit c888791
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions src/components/toolbar/toolbar.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
// Standard/Desktop Heights
$toolbar-tools-height: 64px !default;
$toolbar-height: 64px !default;
$toolbar-medium-tall-height: 88px !default;
$toolbar-tall-height: 128px !default;

// Mobile portrait heights
$toolbar-tools-height-mobile-portrait: 56px !default;
$toolbar-height-mobile-portrait: 56px !default;

// Mobile landscape heights
$toolbar-tools-height-mobile-landscape: 48px !default;
$toolbar-height-mobile-landscape: 48px !default;


$toolbar-indent-margin: 64px !default;
$toolbar-padding: 16px !default;

Expand All @@ -18,6 +29,7 @@ md-toolbar {
font-size: rem(2.0);
min-height: $baseline-grid * 8;
width: 100%;

&.md-whiteframe-z1-add, &.md-whiteframe-z1-remove {
transition: box-shadow $swift-ease-in-out-duration linear;
}
Expand Down Expand Up @@ -107,3 +119,31 @@ md-toolbar {
border-bottom: 1px solid #fff;
}
}

// Handle mobile portrait
@media only screen and (min-width: 0) and (max-width: $layout-breakpoint-sm) and
(orientation: portrait) {
md-toolbar {
background: green;
min-height: $toolbar-height-mobile-portrait;
}

.md-toolbar-tools {
height: $toolbar-height-mobile-portrait;
max-height: $toolbar-height-mobile-portrait;
}
}

// Handle mobile landscape
@media only screen and (min-width: 0) and (max-width: $layout-breakpoint-sm) and
(orientation: landscape) {
md-toolbar {
min-height: $toolbar-height-mobile-landscape;
}

.md-toolbar-tools {
height: $toolbar-height-mobile-landscape;
max-height: $toolbar-height-mobile-landscape;
}
}

0 comments on commit c888791

Please sign in to comment.