2 Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
3 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 Code distributed by Google as part of the polymer project is also
7 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8 --><html><head><link rel=
"import" href=
"../polymer/polymer.html">
9 <link rel=
"import" href=
"../iron-flex-layout/iron-flex-layout.html">
12 `paper-header-panel` contains a header section and a content panel section.
14 __Important:__ The `paper-header-panel` will not display if its parent does not have a height.
16 Using layout classes, you can make the `paper-header-panel` fill the screen
18 <body class="fullbleed layout vertical">
19 <paper-header-panel class="flex">
21 <div>Hello World!</div>
26 Special support is provided for scrolling modes when one uses a paper-toolbar or equivalent for the
32 <paper-toolbar>Header</paper-toolbar>
33 <div>Content goes here...</div>
36 If you want to use other than `paper-toolbar` for the header, add `paper-header` class to that
42 <div class="paper-header">Header</div>
43 <div>Content goes here...</div>
46 To have the content fit to the main area, use the `fit` class.
49 <div class="paper-header">standard</div>
50 <div class="fit">content fits 100% below the header</div>
55 Controls header and scrolling behavior. Options are `standard`, `seamed`, `waterfall`, `waterfall-tall`, `scroll` and
56 `cover`. Default is `standard`.
59 ----------------|-------------
60 `standard` | The header is a step above the panel. The header will consume the panel at the point of entry, preventing it from passing through to the opposite side.
61 `seamed` | The header is presented as seamed with the panel.
62 `waterfall` | Similar to standard mode, but header is initially presented as seamed with panel, but then separates to form the step.
63 `waterfall-tall` | The header is initially taller (`tall` class is added to the header). As the user scrolls, the header separates (forming an edge) while condensing (`tall` class is removed from the header).
64 `scroll` | The header keeps its seam with the panel, and is pushed off screen.
65 `cover` | The panel covers the whole `paper-header-panel` including the header. This allows user to style the panel in such a way that the panel is partially covering the header.
69 <paper-header-panel mode="waterfall">
70 <div class="paper-header">standard</div>
71 <div class="content fit">content fits 100% below the header</div>
77 To change the shadow that shows up underneath the header:
80 --paper-header-panel-shadow: {
83 box-shadow: inset 0px 5px 6px -3px rgba(0, 0, 0, 0.4);
87 To change the panel container in different modes:
90 --paper-header-panel-standard-container: {
91 border: 1px solid gray;
94 --paper-header-panel-cover-container: {
95 border: 1px solid gray;
98 --paper-header-panel-waterfall-container: {
99 border: 1px solid gray;
102 --paper-header-panel-waterfall-tall-container: {
103 border: 1px solid gray;
107 @group Paper Elements
108 @element paper-header-panel
109 @demo demo/index.html
113 </head><body><dom-module id=
"paper-header-panel">
118 @apply(--layout-vertical);
124 /* Create a stack context, we will need it for the shadow*/
130 * Default paper header panel shadow
132 --paper-header-panel-shadow: {
135 box-shadow: inset
0px
5px
6px -
3px rgba(
0,
0,
0,
0.4);
140 @apply(--layout-flex);
145 -webkit-overflow-scrolling: touch;
146 flex-basis:
0.0001px;
152 :host([mode=scroll]) #mainContainer {
153 @apply(--paper-header-panel-scroll-container);
157 :host([mode=scroll]) {
160 -webkit-overflow-scrolling: touch;
166 :host([mode=cover]) #mainContainer {
167 @apply(--paper-header-panel-cover-container);
178 :host([mode=standard]) #mainContainer {
179 @apply(--paper-header-panel-standard-container);
185 :host([mode=waterfall]) #mainContainer {
186 @apply(--paper-header-panel-waterfall-container);
190 * mode: waterfall-tall
192 :host([mode=waterfall-tall]) #mainContainer {
193 @apply(--paper-header-panel-waterfall-tall-container);
196 :host ::content paper-toolbar,
197 :host ::content .paper-header {
199 overflow: visible !important;
202 :host ::content paper-toolbar:after,
203 :host ::content .paper-header:after {
204 @apply(--paper-header-panel-shadow);
206 -webkit-transition: opacity
0.5s, -webkit-transform
0.5s;
207 transition: opacity
0.5s, transform
0.5s;
218 -webkit-transform: scale3d(
1,
0,
1);
219 -webkit-transform-origin:
0%
0%;
221 transform: scale3d(
1,
0,
1);
222 transform-origin:
0%
0%;
225 :host ::content paper-toolbar.has-shadow:after,
226 :host ::content .paper-header.has-shadow:after {
228 -webkit-transform: scale3d(
1,
1,
1);
229 transform: scale3d(
1,
1,
1);
234 <content id=
"headerContent" select=
"paper-toolbar, .paper-header"></content>
235 <div id=
"mainContainer" class$=
"[[_computeMainContainerClass(mode)]]">
236 <content id=
"mainContent" select=
"*"></content>
242 <script src=
"paper-header-panel-extracted.js"></script></body></html>