2 Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
3 This code may only be used under the BSD style license found at http://polymer.github.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/CONTRIBUTORS.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/PATENTS.txt
13 Material Design: <a href="http://www.google.com/design/spec/components/buttons.html">Buttons</a>
15 `paper-button` is a button. When the user touches the button, a ripple effect emanates
16 from the point of contact. It may be flat or raised. A raised button is styled with a
21 <paper-button>flat button</paper-button>
22 <paper-button raised>raised button</paper-button>
23 <paper-button noink>No ripple effect</paper-button>
25 You may use custom DOM in the button body to create a variety of buttons. For example, to
26 create a button with an icon and some text:
29 <core-icon icon="favorite"></core-icon>
36 Style the button with CSS as you would a normal DOM element.
38 /* make #my-button green with yellow text */
44 By default, the ripple is the same color as the foreground at 25% opacity. You may
45 customize the color using this selector:
47 /* make #my-button use a blue ripple instead of foreground color */
48 #my-button::shadow #ripple {
52 The opacity of the ripple is not customizable via CSS.
55 @extends paper-button-base
59 <link href=
"../polymer/polymer.html" rel=
"import">
60 <link href=
"../paper-shadow/paper-shadow.html" rel=
"import">
62 <link href=
"paper-button-base.html" rel=
"import">
64 <polymer-element name=
"paper-button" extends=
"paper-button-base" attributes=
"raised recenteringTouch fill"
72 display: inline-block;
74 box-sizing: border-box;
77 background: transparent;
80 text-transform: uppercase;
83 -moz-user-select: none;
84 -ms-user-select: none;
85 -webkit-user-select: none;
99 text-transform: inherit;
103 border-radius: inherit;
107 pointer-events: none;
112 padding:
0.7em
0.57em
115 polyfill-next-selector { content: '.button-content
> a'; }
118 padding:
0.7em
0.57em;
120 -ms-flex:
1 1 0.000000001px;
123 -webkit-flex-basis:
0.000000001px;
124 flex-basis:
0.000000001px;
129 <template if=
"{{raised}}">
130 <paper-shadow id=
"shadow" fit animated
></paper-shadow>
133 <!-- this div is needed to position the ripple behind text content -->
134 <div class=
"button-content" relative layout horizontal center-center
>
146 * If true, the button will be styled with a shadow.
155 * By default the ripple emanates from where the user touched the button.
156 * Set this to true to always center the ripple.
158 * @attribute recenteringTouch
162 recenteringTouch
: false,
165 * By default the ripple expands to fill the button. Set this to true to
166 * constrain the ripple to a circle within the button.