OLD | NEW |
(Empty) | |
| 1 <!-- |
| 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.g
ithub.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/CONTRI
BUTORS.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/PATEN
TS.txt |
| 8 --> |
| 9 |
| 10 <!-- |
| 11 |
| 12 `paper-card` is a container that renders two shadows on top of each other to |
| 13 create the effect of a lifted piece of paper. |
| 14 |
| 15 Example: |
| 16 |
| 17 <paper-card elevation="1"> |
| 18 ... card content ... |
| 19 </paper-card> |
| 20 |
| 21 @group Paper Elements |
| 22 @class paper-card |
| 23 --> |
| 24 |
| 25 <link href="../polymer/polymer.html" rel="import"> |
| 26 <link href="../paper-styles/shadow.html" rel="import"> |
| 27 <dom-module id="paper-card"> |
| 28 <style> |
| 29 :host { |
| 30 display: block; |
| 31 position: relative; |
| 32 mixin(--shadow-transition); |
| 33 } |
| 34 |
| 35 :host([elevation="1"]) { |
| 36 mixin(--shadow-elevation-1); |
| 37 } |
| 38 |
| 39 :host([elevation="2"]) { |
| 40 mixin(--shadow-elevation-2); |
| 41 } |
| 42 |
| 43 :host([elevation="3"]) { |
| 44 mixin(--shadow-elevation-3); |
| 45 } |
| 46 |
| 47 :host([elevation="4"]) { |
| 48 mixin(--shadow-elevation-4); |
| 49 } |
| 50 |
| 51 :host([elevation="5"]) { |
| 52 mixin(--shadow-elevation-5); |
| 53 } |
| 54 </style> |
| 55 <template> |
| 56 <content></content> |
| 57 </template> |
| 58 </dom-module> |
| 59 <script> |
| 60 Polymer({ |
| 61 is: 'paper-card', |
| 62 |
| 63 enableCustomStyleProperties: true, |
| 64 |
| 65 properties: { |
| 66 |
| 67 /** |
| 68 * The z-depth of this card, from 0-5. Setting to 0 will remove the |
| 69 * shadow, and each increasing number greater than 0 will be "deeper" |
| 70 * than the last. |
| 71 * |
| 72 * @attribute elevation |
| 73 * @type number |
| 74 * @default 1 |
| 75 */ |
| 76 elevation: { |
| 77 type: Number, |
| 78 reflectToAttribute: true, |
| 79 value: 1 |
| 80 }, |
| 81 |
| 82 /** |
| 83 * Set this to true to animate the shadow when setting a new |
| 84 * `elevation` value. |
| 85 * |
| 86 * @attribute animated |
| 87 * @type boolean |
| 88 * @default false |
| 89 */ |
| 90 animated: { |
| 91 type: Boolean, |
| 92 reflectToAttribute: true, |
| 93 value: false |
| 94 } |
| 95 } |
| 96 }); |
| 97 </script> |
OLD | NEW |