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

Commit 92ed465

Browse files
author
Robert Messerle
committed
fix(toolbar): adds shadow when content moves under 'scroll shrink' toolbar
1 parent 4917a16 commit 92ed465

4 files changed

Lines changed: 11 additions & 2 deletions

File tree

docs/app/css/style.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,12 @@ code:not(.highlight) {
202202
.docs-menu li {
203203
margin: 0;
204204
}
205+
.docs-menu > li:nth-child(1) {
206+
border-top: none;
207+
}
208+
.md-whiteframe-glow-z2 {
209+
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);
210+
}
205211
.docs-menu > li {
206212
border-top: 1px solid rgba(0, 0, 0, 0.12);
207213
}

docs/config/template/index.template.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
md-component-id="left"
2222
md-is-locked-open="$mdMedia('gt-sm')">
2323

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

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

6464
<div class="md-toolbar-tools docs-toolbar-tools" ng-click="openMenu()" tabIndex="-1">
6565
<md-button class="md-icon-button" hide-gt-sm aria-label="Toggle Menu">

src/components/toolbar/toolbar.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ function mdToolbarDirective($$rAF, $mdConstant, $mdUtil, $mdTheming) {
127127
Math.max(0, y + scrollTop - prevScrollTop)
128128
);
129129

130+
element[y ? 'addClass' : 'removeClass']('md-whiteframe-z1');
131+
130132
element.css(
131133
$mdConstant.CSS.TRANSFORM,
132134
'translate3d(0,' + (-y * shrinkSpeedFactor) + 'px,0)'

src/components/toolbar/toolbar.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ md-toolbar {
1818
font-size: 2.0rem;
1919
min-height: $baseline-grid * 8;
2020
width: 100%;
21+
transition: box-shadow $swift-ease-in-out-duration linear;
2122

2223
*,
2324
*:before,

0 commit comments

Comments
 (0)