Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / polymer / v1_0 / components-chromium / paper-fab / paper-fab.html
blobaa0b7c0c374bd7838fae5ae1ed76c5e5241590e3
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.github.io/LICENSE.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/CONTRIBUTORS.txt
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/PATENTS.txt
9 --><html><head><link rel="import" href="../polymer/polymer.html">
10 <link rel="import" href="../iron-icon/iron-icon.html">
11 <link rel="import" href="../iron-flex-layout/classes/iron-flex-layout.html">
12 <link rel="import" href="../paper-styles/default-theme.html">
13 <link rel="import" href="../paper-styles/color.html">
14 <link rel="import" href="../paper-material/paper-material.html">
15 <link rel="import" href="../paper-ripple/paper-ripple.html">
16 <link rel="import" href="../paper-behaviors/paper-button-behavior.html">
18 <!--
19 Material Design: <a href="http://www.google.com/design/spec/components/buttons.html">Button</a>
21 `paper-fab` is a floating action button. It contains an image placed in the center and
22 comes in two sizes: regular size and a smaller size by applying the attribute `mini`. When
23 the user touches the button, a ripple effect emanates from the center of the button.
25 You may import `iron-icons` to use with this element, or provide a URL to a custom icon.
26 See `iron-iconset` for more information about how to use a custom icon set.
28 Example:
30 <link href="path/to/iron-icons/iron-icons.html" rel="import">
32 <paper-fab icon="add"></paper-fab>
33 <paper-fab mini icon="favorite"></paper-fab>
34 <paper-fab src="star.png"></paper-fab>
37 ### Styling
39 The following custom properties and mixins are available for styling:
41 Custom property | Description | Default
42 ----------------|-------------|----------
43 `--paper-fab-background` | The background color of the button | `--accent-color`
44 `--paper-fab-keyboard-focus-background` | The background color of the button when focused | `--paper-pink-900`
45 `--paper-fab-disabled-background` | The background color of the button when it's disabled | `--paper-grey-300`
46 `--paper-fab-disabled-text` | The text color of the button when it's disabled | `--paper-grey-500`
47 `--paper-fab` | Mixin applied to the button | `{}`
48 `--paper-fab-mini` | Mixin applied to a mini button | `{}`
49 `--paper-fab-disabled` | Mixin applied to a disabled button | `{}`
51 @group Paper Elements
52 @demo demo/index.html
54 -->
56 </head><body><dom-module id="paper-fab">
57 <style>
59 :host {
60 display: inline-block;
61 position: relative;
62 outline: none;
63 -moz-user-select: none;
64 -ms-user-select: none;
65 -webkit-user-select: none;
66 -webkit-tap-highlight-color: rgba(0,0,0,0);
67 user-select: none;
68 cursor: pointer;
70 box-sizing: border-box;
71 min-width: 0;
72 width: 56px;
73 height: 56px;
74 background: var(--paper-fab-background, --accent-color);
75 color: var(--text-primary-color);
76 border-radius: 50%;
77 padding: 16px;
79 z-index: 0;
81 @apply(--paper-fab);
84 :host([mini]) {
85 width: 40px;
86 height: 40px;
87 padding: 8px;
89 @apply(--paper-fab-mini);
92 :host([disabled]) {
93 color: var(--paper-fab-disabled-text, --paper-grey-500);
94 background: var(--paper-fab-disabled-background, --paper-grey-300);
95 @apply(--paper-fab-disabled);
98 paper-material {
99 border-radius: inherit;
100 @apply(--layout-fit);
101 @apply(--layout-vertical);
102 @apply(--layout-center-center);
105 .keyboard-focus {
106 background: var(--paper-fab-keyboard-focus-background, --paper-pink-900);
108 </style>
109 <template>
110 <paper-ripple></paper-ripple>
111 <paper-material class$="[[_computeContentClass(receivedFocusFromKeyboard)]]" elevation="[[_elevation]]" animated="">
112 <iron-icon id="icon" src="[[src]]" icon="[[icon]]"></iron-icon>
113 </paper-material>
114 </template>
115 </dom-module>
116 <script src="paper-fab-extracted.js"></script></body></html>