3 Copyright 2013 The Polymer Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style
5 license that can be found in the LICENSE file.
9 <title>paper-shadow</title>
10 <meta charset="utf-8">
11 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
12 <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
13 <script src="../platform/platform.js"></script>
14 <link href="paper-shadow.html" rel="import">
17 font-family: RobotoDraft, 'Helvetica Neue', Helvetica, Arial;
18 transform: translateZ(0);
19 -webkit-transform: translateZ(0);
20 transform: translateZ(0);
23 -webkit-user-select: none;
28 display: -webkit-flex;
35 -webkit-flex: 1 1 auto;
38 -webkit-user-select: text;
63 <paper-shadow></paper-shadow>
76 <!-- Example of using paper-shadow to add a shadow to an element -->
79 <paper-shadow z="1"></paper-shadow>
88 <!-- Example of using paper-shadow as part of a Polymer element -->
89 <polymer-element name="x-card" attributes="z">
96 <paper-shadow z="{{z}}"></paper-shadow>
101 z: {value: 1, reflect: true}
107 <x-card class="card" z="2"></x-card>
115 <!-- Example of using paper-shadow by adding a class directly -->
117 <div class="card paper-shadow-top-z-3">
118 <div class="card-inner paper-shadow-bottom-z-3">
129 <div class="card paper-shadow-top-z-4">
130 <div class="card-inner paper-shadow-bottom-z-4">
141 <div class="card paper-shadow-top-z-5">
142 <div class="card-inner paper-shadow-bottom-z-5">
156 <polymer-element name="x-shadow" attributes="z" on-tap="{{tapAction}}">
160 .paper-shadow-bottom {
167 :host(.fab) .paper-shadow-bottom {
173 <paper-shadow z="{{z}}" animated></paper-shadow>
176 Polymer('x-shadow', {
178 z: {value: 0, reflect: true}
181 zChanged: function() {
182 this.fire('shadow-z-changed');
184 tapAction: function() {
207 <x-shadow id="card" z="0" class="card"></x-shadow>
210 Tap to lift/drop the card.
212 Current z-index = <span id="card-z">0</span>
215 document.addEventListener('polymer-ready', function() {
216 var fab = document.getElementById('card');
217 fab.addEventListener('shadow-z-changed', function() {
218 document.getElementById('card-z').textContent = fab.z;
231 <x-shadow id="fab" z="0" class="fab"></x-shadow>
234 Tap to lift/drop the button.
236 Current z-index = <span id="fab-z">0</span>
239 document.addEventListener('polymer-ready', function() {
240 var fab = document.getElementById('fab');
241 fab.addEventListener('shadow-z-changed', function() {
242 document.getElementById('fab-z').textContent = fab.z;