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 @group Paper Elements |
| 11 |
| 12 Material Design: <a href="http://www.google.com/design/spec/components/buttons.h
tml">Buttons</a> |
| 13 |
| 14 `paper-icon-button` is a button with an image placed at the center. When the use
r touches |
| 15 the button, a ripple effect emanates from the center of the button. |
| 16 |
| 17 `paper-icon-button` includes a default icon set. Use `icon` to specify which ic
on |
| 18 from the icon set to use. |
| 19 |
| 20 <paper-icon-button icon="menu"></paper-icon-button> |
| 21 |
| 22 See [`iron-iconset`](#iron-iconset) for more information about |
| 23 how to use a custom icon set. |
| 24 |
| 25 Example: |
| 26 |
| 27 <link href="path/to/iron-icons/iron-icons.html" rel="import"> |
| 28 |
| 29 <paper-icon-button icon="favorite"></paper-icon-button> |
| 30 <paper-icon-button src="star.png"></paper-icon-button> |
| 31 |
| 32 Styling |
| 33 ------- |
| 34 |
| 35 Style the button with CSS as you would a normal DOM element. If you are using th
e icons |
| 36 provided by `iron-icons`, they will inherit the foreground color of the button. |
| 37 |
| 38 /* make a red "favorite" button */ |
| 39 <paper-icon-button icon="favorite" style="color: red;"></paper-icon-button> |
| 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 #ripple { |
| 46 color: blue; |
| 47 } |
| 48 |
| 49 The opacity of the ripple is not customizable via CSS. |
| 50 |
| 51 @element paper-icon-button |
| 52 @homepage github.io |
| 53 --><html><head><link rel="import" href="../polymer/polymer.html"> |
| 54 <link rel="import" href="../iron-icon/iron-icon.html"> |
| 55 <link rel="import" href="../iron-flex-layout/iron-flex-layout.html"> |
| 56 <link rel="import" href="../paper-styles/default-theme.html"> |
| 57 <link rel="import" href="../paper-behaviors/paper-button-behavior.html"> |
| 58 <link rel="import" href="../paper-ripple/paper-ripple.html"> |
| 59 |
| 60 <style is="x-style"> |
| 61 * { |
| 62 --paper-icon-button-disabled-text: var(--disabled-text-color); |
| 63 } |
| 64 </style> |
| 65 |
| 66 </head><body><dom-module id="paper-icon-button"> |
| 67 <style> |
| 68 :host { |
| 69 display: inline-block; |
| 70 position: relative; |
| 71 padding: 8px; |
| 72 outline: none; |
| 73 -webkit-user-select: none; |
| 74 -moz-user-select: none; |
| 75 -ms-user-select: none; |
| 76 user-select: none; |
| 77 cursor: pointer; |
| 78 z-index: 0; |
| 79 |
| 80 mixin(--paper-icon-button); |
| 81 } |
| 82 |
| 83 :host([disabled]) { |
| 84 color: var(--paper-icon-button-disabled-text); |
| 85 pointer-events: none; |
| 86 cursor: auto; |
| 87 |
| 88 mixin(--paper-icon-button-disabled); |
| 89 } |
| 90 </style> |
| 91 <template> |
| 92 <paper-ripple class="circle" recenters=""></paper-ripple> |
| 93 <iron-icon id="icon" src="[[src]]" icon="[[icon]]"></iron-icon> |
| 94 </template> |
| 95 </dom-module> |
| 96 <script src="paper-icon-button-extracted.js"></script></body></html> |
OLD | NEW |