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

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 #2047

closes #4161
  • Loading branch information
topherfangio authored and Robert Messerle committed Aug 17, 2015
1 parent a12f940 commit b6e1098
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 @@ -113,3 +125,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;
}
}

4 comments on commit b6e1098

@lmadeira
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you set background to green at line 133? What about primaryPalette theme?
md-toolbar {

  • background: green;

@robertmesserle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lmadeira Good question. I removed this, assuming it was used for debugging and accidentally left in.

8c71d0c

@topherfangio Just wanted to mention you here to confirm my suspicions.

@lmadeira
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Robert. You guys are doing an amazing job here!

@topherfangio
Copy link
Contributor Author

@topherfangio topherfangio commented on b6e1098 Aug 18, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.