OLD | NEW |
(Empty) | |
| 1 paper-scroll-header-panel |
| 2 ======================== |
| 3 |
| 4 `paper-scroll-header-panel` contains a header section and a content section. The
header is initially on the top part of the view but it scrolls away with the re
st of the scrollable content. Upon scrolling slightly up at any point, the heade
r scrolls back into view. This saves screen space and allows users to access imp
ortant controls by easily moving them back to the view. |
| 5 |
| 6 Important: The `paper-scroll-header-panel` will not display if its parent does n
ot have a height. Using layout classes, you can easily make the `paper-scroll-he
ader-panel` fill the screen |
| 7 |
| 8 ```html |
| 9 <body class="fullbleed layout vertical"> |
| 10 <paper-scroll-header-panel class="flex"> |
| 11 <paper-toolbar> |
| 12 Hello World! |
| 13 </paper-toolbar> |
| 14 </paper-scroll-header-panel> |
| 15 </body> |
| 16 ``` |
| 17 or, if you would prefer to do it in CSS, just give html, body, and `paper-scroll
-header-panel` a height of 100%: |
| 18 ```css |
| 19 html, body { |
| 20 height: 100%; |
| 21 margin: 0; |
| 22 } |
| 23 paper-scroll-header-panel { |
| 24 height: 100%; |
| 25 } |
| 26 ``` |
| 27 `paper-scroll-header-panel` works well with `paper-toolbar` but can use any elem
ent that represents a header by adding a core-header class to it. |
| 28 |
| 29 ```html |
| 30 <paper-scroll-header-panel> |
| 31 <paper-toolbar>Header</paper-toolbar> |
| 32 <div>Content goes here...</div> |
| 33 </paper-scroll-header-panel> |
| 34 ``` |
| 35 |
| 36 ### Styling scroll-header-panel: |
| 37 |
| 38 To change background for toolbar when it is at its full size: |
| 39 |
| 40 ```css |
| 41 paper-scroll-header-panel { |
| 42 --paper-scroll-header-panel-full-header: { |
| 43 background-color: red; |
| 44 }; |
| 45 } |
| 46 ``` |
| 47 |
| 48 To change the background for toolbar when it is condensed: |
| 49 |
| 50 ```css |
| 51 paper-scroll-header-panel { |
| 52 --paper-scroll-header-panel-condensed-header: { |
| 53 background-color: #f4b400; |
| 54 }; |
| 55 } |
| 56 ``` |
OLD | NEW |