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

Commit

Permalink
fix(toolbar): adds shadow when content moves under 'scroll shrink' to…
Browse files Browse the repository at this point in the history
…olbar
  • Loading branch information
Robert Messerle committed Apr 30, 2015
1 parent 4917a16 commit 92ed465
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions docs/app/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ code:not(.highlight) {
.docs-menu li {
margin: 0;
}
.docs-menu > li:nth-child(1) {
border-top: none;
}
.md-whiteframe-glow-z2 {
box-shadow: 0px 0px 3px 3px rgba(0, 0, 0, 0.2), 0px 0 4px 3px rgba(0, 0, 0, 0.14), 0px 0px 8px 1px rgba(0, 0, 0, 0.12);
}
.docs-menu > li {
border-top: 1px solid rgba(0, 0, 0, 0.12);
}
Expand Down
4 changes: 2 additions & 2 deletions docs/config/template/index.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
md-component-id="left"
md-is-locked-open="$mdMedia('gt-sm')">

<md-toolbar>
<md-toolbar class="md-whiteframe-glow-z2">
<h1 class="md-toolbar-tools">
<a ng-href="#/" layout="row" flex class="docs-logo">
<md-icon md-svg-src="menu"></md-icon>
Expand Down Expand Up @@ -59,7 +59,7 @@ <h2 class="menu-heading md-subhead" ng-if="section.type === 'heading'" id="headi
</md-sidenav>

<div layout="column" tabIndex="-1" role="main" flex>
<md-toolbar>
<md-toolbar class="md-whiteframe-glow-z2">

<div class="md-toolbar-tools docs-toolbar-tools" ng-click="openMenu()" tabIndex="-1">
<md-button class="md-icon-button" hide-gt-sm aria-label="Toggle Menu">
Expand Down
2 changes: 2 additions & 0 deletions src/components/toolbar/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ function mdToolbarDirective($$rAF, $mdConstant, $mdUtil, $mdTheming) {
Math.max(0, y + scrollTop - prevScrollTop)
);

element[y ? 'addClass' : 'removeClass']('md-whiteframe-z1');

element.css(
$mdConstant.CSS.TRANSFORM,
'translate3d(0,' + (-y * shrinkSpeedFactor) + 'px,0)'
Expand Down
1 change: 1 addition & 0 deletions src/components/toolbar/toolbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ md-toolbar {
font-size: 2.0rem;
min-height: $baseline-grid * 8;
width: 100%;
transition: box-shadow $swift-ease-in-out-duration linear;

*,
*:before,
Expand Down

0 comments on commit 92ed465

Please sign in to comment.