OLD | NEW |
| (Empty) |
1 <!-- | |
2 @license | |
3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | |
4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | |
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | |
6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | |
7 Code distributed by Google as part of the polymer project is also | |
8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | |
9 --><html><head><link rel="import" href="../polymer/polymer.html"> | |
10 <link rel="import" href="../iron-flex-layout/classes/iron-flex-layout.html"> | |
11 <link rel="import" href="../paper-styles/paper-styles.html"> | |
12 | |
13 <!-- | |
14 `paper-dialog-scrollable` implements a scrolling area used in a Material Design
dialog. It shows | |
15 a divider at the top and/or bottom indicating more content, depending on scroll
position. Use this | |
16 together with elements implementing `Polymer.PaperDialogBehavior`. | |
17 | |
18 <paper-dialog-impl> | |
19 <h2>Header</h2> | |
20 <paper-dialog-scrollable> | |
21 Lorem ipsum... | |
22 </paper-dialog-scrollable> | |
23 <div class="buttons"> | |
24 <paper-button>OK</paper-button> | |
25 </div> | |
26 </paper-dialog-impl> | |
27 | |
28 It shows a top divider after scrolling if it is not the first child in its paren
t container, | |
29 indicating there is more content above. It shows a bottom divider if it is scrol
lable and it is not | |
30 the last child in its parent container, indicating there is more content below.
The bottom divider | |
31 is hidden if it is scrolled to the bottom. | |
32 | |
33 @group Paper Elements | |
34 @element paper-dialog-scrollable | |
35 @demo demo/index.html | |
36 @hero hero.svg | |
37 --> | |
38 | |
39 </head><body><dom-module id="paper-dialog-scrollable"> | |
40 | |
41 <style> | |
42 | |
43 :host { | |
44 display: block; | |
45 position: relative; | |
46 } | |
47 | |
48 :host(.is-scrolled:not(:first-child))::before { | |
49 content: ''; | |
50 position: absolute; | |
51 top: 0; | |
52 left: 0; | |
53 right: 0; | |
54 height: 1px; | |
55 background: var(--divider-color); | |
56 } | |
57 | |
58 :host(.can-scroll:not(.scrolled-to-bottom):not(:last-child))::after { | |
59 content: ''; | |
60 position: absolute; | |
61 bottom: 0; | |
62 left: 0; | |
63 right: 0; | |
64 height: 1px; | |
65 background: var(--divider-color); | |
66 } | |
67 | |
68 .scrollable { | |
69 padding: 0 24px; | |
70 | |
71 @apply(--layout-scroll); | |
72 | |
73 @apply(--paper-dialog-scrollable); | |
74 } | |
75 </style> | |
76 | |
77 <template> | |
78 <div id="scrollable" class="scrollable"> | |
79 <content></content> | |
80 </div> | |
81 </template> | |
82 | |
83 </dom-module> | |
84 | |
85 <script src="paper-dialog-scrollable-extracted.js"></script></body></html> | |
OLD | NEW |