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 | 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE |
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS | 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS |
6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS | 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS |
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 | 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS |
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-material/paper-material.html"> | 12 <link rel="import" href="../paper-material/paper-material.html"> |
13 <link rel="import" href="../paper-ripple/paper-ripple.html"> | 13 <link rel="import" href="../paper-ripple/paper-ripple.html"> |
14 <link rel="import" href="../paper-behaviors/paper-button-behavior.html"> | 14 <link rel="import" href="../paper-behaviors/paper-button-behavior.html"> |
15 | 15 |
16 <!-- | 16 <!-- |
17 | 17 |
18 Material Design: <a href="http://www.google.com/design/spec/components/buttons.h
tml">Buttons</a> | 18 Material Design: <a href="http://www.google.com/design/spec/components/buttons.h
tml">Buttons</a> |
19 | 19 |
20 `paper-button` is a button. When the user touches the button, a ripple effect em
anates | 20 `paper-button` is a button. When the user touches the button, a ripple effect em
anates |
21 from the point of contact. It may be flat or raised. A raised button is styled w
ith a | 21 from the point of contact. It may be flat or raised. A raised button is styled w
ith a |
22 shadow. | 22 shadow. |
23 | 23 |
24 Example: | 24 Example: |
25 | 25 |
26 <paper-button>flat button</paper-button> | 26 <paper-button>flat button</paper-button> |
27 <paper-button raised>raised button</paper-button> | 27 <paper-button raised>raised button</paper-button> |
28 <paper-button noink>No ripple effect</paper-button> | 28 <paper-button noink>No ripple effect</paper-button> |
| 29 <paper-button toggles>toggle-able button</paper-button> |
| 30 |
| 31 A button that has `toggles` true will remain `active` after being clicked (and |
| 32 will have an `active` attribute set). For more information, see the `Polymer.Iro
nButtonState` |
| 33 behavior. |
29 | 34 |
30 You may use custom DOM in the button body to create a variety of buttons. For ex
ample, to | 35 You may use custom DOM in the button body to create a variety of buttons. For ex
ample, to |
31 create a button with an icon and some text: | 36 create a button with an icon and some text: |
32 | 37 |
33 <paper-button> | 38 <paper-button> |
34 <core-icon icon="favorite"></core-icon> | 39 <iron-icon icon="favorite"></iron-icon> |
35 custom button content | 40 custom button content |
36 </paper-button> | 41 </paper-button> |
37 | 42 |
38 ### Styling | 43 ### Styling |
39 | 44 |
40 Style the button with CSS as you would a normal DOM element. | 45 Style the button with CSS as you would a normal DOM element. |
41 | 46 |
42 /* make #my-button green with yellow text */ | 47 /* make #my-button green with yellow text */ |
43 #my-button { | 48 #my-button { |
44 background: green; | 49 background: green; |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 _computeContentClass: function(receivedFocusFromKeyboard) { | 173 _computeContentClass: function(receivedFocusFromKeyboard) { |
169 var className = 'content '; | 174 var className = 'content '; |
170 if (receivedFocusFromKeyboard) { | 175 if (receivedFocusFromKeyboard) { |
171 className += ' keyboard-focus'; | 176 className += ' keyboard-focus'; |
172 } | 177 } |
173 return className; | 178 return className; |
174 } | 179 } |
175 }); | 180 }); |
176 | 181 |
177 </script> | 182 </script> |
OLD | NEW |