OLD | NEW |
(Empty) | |
| 1 <!-- |
| 2 @license |
| 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 |
| 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 |
| 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 |
| 9 --><!-- |
| 10 |
| 11 Material Design: <a href="http://www.google.com/design/spec/components/buttons.h
tml">Buttons</a> |
| 12 |
| 13 `paper-button` is a button. When the user touches the button, a ripple effect em
anates |
| 14 from the point of contact. It may be flat or raised. A raised button is styled w
ith a |
| 15 shadow. |
| 16 |
| 17 Example: |
| 18 |
| 19 <paper-button>flat button</paper-button> |
| 20 <paper-button raised>raised button</paper-button> |
| 21 <paper-button noink>No ripple effect</paper-button> |
| 22 |
| 23 You may use custom DOM in the button body to create a variety of buttons. For ex
ample, to |
| 24 create a button with an icon and some text: |
| 25 |
| 26 <paper-button> |
| 27 <core-icon icon="favorite"></core-icon> |
| 28 custom button content |
| 29 </paper-button> |
| 30 |
| 31 ## Styling |
| 32 |
| 33 Style the button with CSS as you would a normal DOM element. |
| 34 |
| 35 /* make #my-button green with yellow text */ |
| 36 #my-button { |
| 37 background: green; |
| 38 color: yellow; |
| 39 } |
| 40 |
| 41 By default, the ripple is the same color as the foreground at 25% opacity. You m
ay |
| 42 customize the color using this selector: |
| 43 |
| 44 /* make #my-button use a blue ripple instead of foreground color */ |
| 45 #my-button::shadow paper-ripple { |
| 46 color: blue; |
| 47 } |
| 48 |
| 49 The opacity of the ripple is not customizable via CSS. |
| 50 |
| 51 --><html><head><link rel="import" href="../polymer/polymer.html"> |
| 52 <link rel="import" href="../paper-card/paper-card.html"> |
| 53 <link rel="import" href="../paper-ripple/paper-ripple.html"> |
| 54 |
| 55 <link rel="import" href="../paper-behaviors/paper-button-behavior.html"> |
| 56 |
| 57 </head><body><dom-module id="paper-button"> |
| 58 |
| 59 <style> |
| 60 |
| 61 :host { |
| 62 display: inline-block; |
| 63 position: relative; |
| 64 box-sizing: border-box; |
| 65 min-width: 5.14em; |
| 66 margin: 0 0.29em; |
| 67 background: transparent; |
| 68 text-align: center; |
| 69 font: inherit; |
| 70 text-transform: uppercase; |
| 71 outline: none; |
| 72 border-radius: 3px; |
| 73 -moz-user-select: none; |
| 74 -ms-user-select: none; |
| 75 -webkit-user-select: none; |
| 76 user-select: none; |
| 77 cursor: pointer; |
| 78 z-index: 0; |
| 79 } |
| 80 |
| 81 :host([disabled]) { |
| 82 background: #eaeaea; |
| 83 color: #a8a8a8; |
| 84 cursor: auto; |
| 85 pointer-events: none; |
| 86 } |
| 87 |
| 88 :host([noink]) paper-ripple { |
| 89 display: none; |
| 90 } |
| 91 |
| 92 paper-card { |
| 93 border-radius: inherit; |
| 94 } |
| 95 |
| 96 .content > ::content * { |
| 97 text-transform: inherit; |
| 98 } |
| 99 |
| 100 .content { |
| 101 padding: 0.7em 0.57em |
| 102 } |
| 103 </style> |
| 104 |
| 105 <template> |
| 106 |
| 107 <paper-ripple></paper-ripple> |
| 108 |
| 109 <paper-card class="content" elevation="[[_elevation]]" animated=""> |
| 110 <content></content> |
| 111 </paper-card> |
| 112 |
| 113 </template> |
| 114 |
| 115 </dom-module> |
| 116 |
| 117 <script src="paper-button-extracted.js"></script></body></html> |
OLD | NEW |