Polymer elements added to third_party/polymer.
[chromium-blink-merge.git] / third_party / polymer / components / paper-icon-button / paper-icon-button.html
blob9e53016c28134c4e2c4432490bd6d03571bfa8fa
1 <!--
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
4 The complete set of authors may be found at http://polymer.github.io/AUTHORS
5 The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
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
8 -->
10 <!--
11 @group Paper Elements
12 `paper-icon-button` is a button with an image placed at the center.
14 Example:
16 <paper-icon-button iconSrc="star.png"></paper-icon-button>
18 `paper-icon-button` includes a default icon set. Use `icon` to specify
19 which icon from the icon set to use.
21 Example:
23 <paper-icon-button icon="menu"></paper-icon-button>
25 The icons provided by `core-icons` are SVG, and you can style them with CSS.
27 Example:
29 <paper-icon-button icon="favorite" style="fill:red;"></paper-icon-button>
31 See `core-iconset` for more information about how to use a custom icon set.
33 @element paper-icon-button
34 @extends paper-button
35 @homepage github.io
36 -->
38 <link href="../core-icon/core-icon.html" rel="import">
39 <link href="../paper-button/paper-button.html" rel="import">
41 <polymer-element name="paper-icon-button" extends="paper-button" attributes="fill">
43 <template>
45 <link href="paper-icon-button.css" rel="stylesheet">
47 <shadow></shadow>
49 </template>
51 <script>
53 Polymer('paper-icon-button', {
55 publish: {
57 /**
58 * If true, the ripple expands to a square to fill the containing box.
60 * @attribute fill
61 * @type boolean
62 * @default false
64 fill: {value: false, reflect: true}
68 ready: function() {
69 this.$.ripple.classList.add('recenteringTouch');
70 this.fillChanged();
73 fillChanged: function() {
74 this.$.ripple.classList.toggle('circle', !this.fill);
77 iconChanged: function(oldIcon) {
78 if (!this.label) {
79 this.setAttribute('aria-label', this.icon);
83 });
85 </script>
87 </polymer-element>