| 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.txt | 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 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.txt | 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 9 --><html><head><link rel="import" href="../polymer/polymer.html"> | 9 --><html><head><link rel="import" href="../polymer/polymer.html"> |
| 10 <link rel="import" href="../iron-icon/iron-icon.html"> | 10 <link rel="import" href="../iron-icon/iron-icon.html"> |
| 11 <link rel="import" href="../iron-flex-layout/iron-flex-layout.html"> | 11 <link rel="import" href="../paper-behaviors/paper-inky-focus-behavior.html"> |
| 12 <link rel="import" href="../paper-styles/default-theme.html"> | 12 <link rel="import" href="../paper-styles/default-theme.html"> |
| 13 <link rel="import" href="../paper-behaviors/paper-button-behavior.html"> | |
| 14 <link rel="import" href="../paper-behaviors/paper-inky-focus-behavior.html"> | |
| 15 <link rel="import" href="../paper-ripple/paper-ripple.html"> | |
| 16 | 13 |
| 17 <!-- | 14 <!-- |
| 18 Material design: [Icon toggles](https://www.google.com/design/spec/components/bu
ttons.html#buttons-toggle-buttons) | 15 Material design: [Icon toggles](https://www.google.com/design/spec/components/bu
ttons.html#buttons-toggle-buttons) |
| 19 | 16 |
| 20 `paper-icon-button` is a button with an image placed at the center. When the use
r touches | 17 `paper-icon-button` is a button with an image placed at the center. When the use
r touches |
| 21 the button, a ripple effect emanates from the center of the button. | 18 the button, a ripple effect emanates from the center of the button. |
| 22 | 19 |
| 23 `paper-icon-button` includes a default icon set. Use `icon` to specify which ic
on | 20 `paper-icon-button` includes a default icon set. Use `icon` to specify which ic
on |
| 24 from the icon set to use. | 21 from the icon set to use. |
| 25 | 22 |
| 26 <paper-icon-button icon="menu"></paper-icon-button> | 23 <paper-icon-button icon="menu"></paper-icon-button> |
| 27 | 24 |
| 28 See [`iron-iconset`](#iron-iconset) for more information about | 25 See [`iron-iconset`](iron-iconset) for more information about |
| 29 how to use a custom icon set. | 26 how to use a custom icon set. |
| 30 | 27 |
| 31 Example: | 28 Example: |
| 32 | 29 |
| 33 <link href="path/to/iron-icons/iron-icons.html" rel="import"> | 30 <link href="path/to/iron-icons/iron-icons.html" rel="import"> |
| 34 | 31 |
| 35 <paper-icon-button icon="favorite"></paper-icon-button> | 32 <paper-icon-button icon="favorite"></paper-icon-button> |
| 36 <paper-icon-button src="star.png"></paper-icon-button> | 33 <paper-icon-button src="star.png"></paper-icon-button> |
| 37 | 34 |
| 35 To use `paper-icon-button` as a link, wrap it in an anchor tag. Since `paper-ico
n-button` |
| 36 will already receive focus, you may want to prevent the anchor tag from receivin
g focus |
| 37 as well by setting its tabindex to -1. |
| 38 |
| 39 <a href="https://www.polymer-project.org" tabindex="-1"> |
| 40 <paper-icon-button icon="polymer"></paper-icon-button> |
| 41 </a> |
| 42 |
| 38 ### Styling | 43 ### Styling |
| 39 | 44 |
| 40 Style the button with CSS as you would a normal DOM element. If you are using th
e icons | 45 Style the button with CSS as you would a normal DOM element. If you are using th
e icons |
| 41 provided by `iron-icons`, they will inherit the foreground color of the button. | 46 provided by `iron-icons`, they will inherit the foreground color of the button. |
| 42 | 47 |
| 43 /* make a red "favorite" button */ | 48 /* make a red "favorite" button */ |
| 44 <paper-icon-button icon="favorite" style="color: red;"></paper-icon-button> | 49 <paper-icon-button icon="favorite" style="color: red;"></paper-icon-button> |
| 45 | 50 |
| 46 By default, the ripple is the same color as the foreground at 25% opacity. You m
ay | 51 By default, the ripple is the same color as the foreground at 25% opacity. You m
ay |
| 47 customize the color using the `--paper-icon-button-ink-color` custom property. | 52 customize the color using the `--paper-icon-button-ink-color` custom property. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 70 padding: 8px; | 75 padding: 8px; |
| 71 outline: none; | 76 outline: none; |
| 72 -webkit-tap-highlight-color: rgba(0,0,0,0); | 77 -webkit-tap-highlight-color: rgba(0,0,0,0); |
| 73 -webkit-user-select: none; | 78 -webkit-user-select: none; |
| 74 -moz-user-select: none; | 79 -moz-user-select: none; |
| 75 -ms-user-select: none; | 80 -ms-user-select: none; |
| 76 user-select: none; | 81 user-select: none; |
| 77 cursor: pointer; | 82 cursor: pointer; |
| 78 z-index: 0; | 83 z-index: 0; |
| 79 line-height: 1; | 84 line-height: 1; |
| 80 | 85 |
| 81 width: 40px; | 86 width: 40px; |
| 82 height: 40px; | 87 height: 40px; |
| 83 | 88 |
| 84 /* Because of polymer/2558, this style has lower specificity than * */ | 89 /* Because of polymer/2558, this style has lower specificity than * */ |
| 85 box-sizing: border-box !important; | 90 box-sizing: border-box !important; |
| 91 |
| 86 @apply(--paper-icon-button); | 92 @apply(--paper-icon-button); |
| 87 } | 93 } |
| 88 | 94 |
| 89 :host #ink { | 95 :host #ink { |
| 90 color: var(--paper-icon-button-ink-color, --primary-text-color); | 96 color: var(--paper-icon-button-ink-color, --primary-text-color); |
| 91 opacity: 0.6; | 97 opacity: 0.6; |
| 92 } | 98 } |
| 93 | 99 |
| 94 :host([disabled]) { | 100 :host([disabled]) { |
| 95 color: var(--paper-icon-button-disabled-text, --disabled-text-color); | 101 color: var(--paper-icon-button-disabled-text, --disabled-text-color); |
| 96 pointer-events: none; | 102 pointer-events: none; |
| 97 cursor: auto; | 103 cursor: auto; |
| 104 |
| 98 @apply(--paper-icon-button-disabled); | 105 @apply(--paper-icon-button-disabled); |
| 99 } | 106 } |
| 100 | 107 |
| 101 :host(:hover) { | 108 :host(:hover) { |
| 102 @apply(--paper-icon-button-hover); | 109 @apply(--paper-icon-button-hover); |
| 103 } | 110 } |
| 104 | 111 |
| 105 iron-icon { | 112 iron-icon { |
| 106 --iron-icon-width: 100%; | 113 --iron-icon-width: 100%; |
| 107 --iron-icon-height: 100%; | 114 --iron-icon-height: 100%; |
| 108 } | 115 } |
| 109 </style> | 116 </style> |
| 117 |
| 110 <iron-icon id="icon" src="[[src]]" icon="[[icon]]" alt$="[[alt]]"></iron-ico
n> | 118 <iron-icon id="icon" src="[[src]]" icon="[[icon]]" alt$="[[alt]]"></iron-ico
n> |
| 111 </template> | 119 </template> |
| 112 | 120 |
| 113 </dom-module> | 121 </dom-module> |
| 114 <script src="paper-icon-button-extracted.js"></script></body></html> | 122 <script src="paper-icon-button-extracted.js"></script></body></html> |
| OLD | NEW |