Skip to content

Commit

Permalink
update(toolbar): add responsive heights as per spec (#2157)
Browse files Browse the repository at this point in the history
* update(toolbar): add responsive heights as per spec

* Adds media queries to dynamically adjust the height of the toolbar according to the specifications.
  https://material.google.com/layout/structure.html#structure-app-bar

Closes #2085.

* Remove extra blank line
  • Loading branch information
devversion authored and jelbourn committed Dec 14, 2016
1 parent 2269a46 commit 78d54fc
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/lib/core/style/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ $md-body-font-size-base: rem(1.4) !default;
$md-font-family: Roboto, 'Helvetica Neue', sans-serif !default;

// Media queries
// TODO: Find a way to respect media query ranges.
// TODO: For example the xs-breakpoint should not interfere with the sm-breakpoint.
$md-xsmall: 'max-width: 600px';
$md-small: 'max-width: 960px';

// TODO: Revisit all z-indices before beta
// z-index master list
Expand Down
28 changes: 25 additions & 3 deletions src/lib/toolbar/toolbar.scss
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
@import '../core/style/variables';

$md-toolbar-height-desktop: 64px !default;
$md-toolbar-height-mobile-portrait: 56px !default;
$md-toolbar-height-mobile-landscape: 48px !default;

$md-toolbar-min-height: 64px !default;
$md-toolbar-font-size: 20px !default;
$md-toolbar-padding: 16px !default;


@mixin md-toolbar-height($height) {
md-toolbar {
min-height: $height;
}
md-toolbar-row {
height: $height;
}
}

md-toolbar {
display: flex;
box-sizing: border-box;

width: 100%;
min-height: $md-toolbar-min-height;

// Font Styling
font-size: $md-toolbar-font-size;
Expand All @@ -27,10 +37,22 @@ md-toolbar {
box-sizing: border-box;

width: 100%;
height: $md-toolbar-min-height;

// Flexbox Vertical Alignment
flex-direction: row;
align-items: center;
}
}

// Set the default height for the toolbar.
@include md-toolbar-height($md-toolbar-height-desktop);

// Specific height for mobile devices in portrait mode.
@media ($md-xsmall) and (orientation: portrait) {
@include md-toolbar-height($md-toolbar-height-mobile-portrait);
}

// Specific height for mobile devices in landscape mode.
@media ($md-small) and (orientation: landscape) {
@include md-toolbar-height($md-toolbar-height-mobile-landscape);
}

0 comments on commit 78d54fc

Please sign in to comment.