| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 @license | 2 @license |
| 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | 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 | 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 | 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 | 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 | 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 | 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 9 --> | 9 --> |
| 10 | 10 |
| 11 <link rel="import" href="../polymer/polymer.html"> | 11 <link rel="import" href="../polymer/polymer.html"> |
| 12 <link rel="import" href="../paper-styles/shadow.html"> | 12 <link rel="import" href="../paper-styles/shadow.html"> |
| 13 <link rel="import" href="paper-material-shared-styles.html"> |
| 13 | 14 |
| 14 <!-- | 15 <!-- |
| 16 Material design: [Cards](https://www.google.com/design/spec/components/cards.htm
l) |
| 15 | 17 |
| 16 `paper-material` is a container that renders two shadows on top of each other to | 18 `paper-material` is a container that renders two shadows on top of each other to |
| 17 create the effect of a lifted piece of paper. | 19 create the effect of a lifted piece of paper. |
| 18 | 20 |
| 19 Example: | 21 Example: |
| 20 | 22 |
| 21 <paper-material elevation="1"> | 23 <paper-material elevation="1"> |
| 22 ... content ... | 24 ... content ... |
| 23 </paper-material> | 25 </paper-material> |
| 24 | 26 |
| 25 @group Paper Elements | 27 @group Paper Elements |
| 26 @class paper-material | |
| 27 @demo demo/index.html | 28 @demo demo/index.html |
| 28 --> | 29 --> |
| 29 | 30 |
| 30 <dom-module id="paper-material"> | 31 <dom-module id="paper-material"> |
| 31 <style> | 32 <template> |
| 32 :host { | 33 <style include="paper-material-shared-styles"></style> |
| 33 display: block; | 34 <style> |
| 34 position: relative; | 35 :host([animated]) { |
| 35 @apply(--shadow-transition); | 36 @apply(--shadow-transition); |
| 36 } | 37 } |
| 38 </style> |
| 37 | 39 |
| 38 :host([elevation="1"]) { | |
| 39 @apply(--shadow-elevation-2dp); | |
| 40 } | |
| 41 | |
| 42 :host([elevation="2"]) { | |
| 43 @apply(--shadow-elevation-4dp); | |
| 44 } | |
| 45 | |
| 46 :host([elevation="3"]) { | |
| 47 @apply(--shadow-elevation-6dp); | |
| 48 } | |
| 49 | |
| 50 :host([elevation="4"]) { | |
| 51 @apply(--shadow-elevation-8dp); | |
| 52 } | |
| 53 | |
| 54 :host([elevation="5"]) { | |
| 55 @apply(--shadow-elevation-16dp); | |
| 56 } | |
| 57 </style> | |
| 58 <template> | |
| 59 <content></content> | 40 <content></content> |
| 60 </template> | 41 </template> |
| 61 </dom-module> | 42 </dom-module> |
| 62 <script> | 43 <script> |
| 63 Polymer({ | 44 Polymer({ |
| 64 is: 'paper-material', | 45 is: 'paper-material', |
| 65 | 46 |
| 66 properties: { | 47 properties: { |
| 67 | |
| 68 /** | 48 /** |
| 69 * The z-depth of this element, from 0-5. Setting to 0 will remove the | 49 * The z-depth of this element, from 0-5. Setting to 0 will remove the |
| 70 * shadow, and each increasing number greater than 0 will be "deeper" | 50 * shadow, and each increasing number greater than 0 will be "deeper" |
| 71 * than the last. | 51 * than the last. |
| 72 * | 52 * |
| 73 * @attribute elevation | 53 * @attribute elevation |
| 74 * @type number | 54 * @type number |
| 75 * @default 1 | 55 * @default 1 |
| 76 */ | 56 */ |
| 77 elevation: { | 57 elevation: { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 89 * @default false | 69 * @default false |
| 90 */ | 70 */ |
| 91 animated: { | 71 animated: { |
| 92 type: Boolean, | 72 type: Boolean, |
| 93 reflectToAttribute: true, | 73 reflectToAttribute: true, |
| 94 value: false | 74 value: false |
| 95 } | 75 } |
| 96 } | 76 } |
| 97 }); | 77 }); |
| 98 </script> | 78 </script> |
| OLD | NEW |