Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Unified Diff: third_party/polymer/v0_8/components/paper-fab/paper-fab.html

Issue 1140583003: Material PDF: Add required Polymer 0.8 elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/polymer/v0_8/components/paper-fab/paper-fab.html
diff --git a/third_party/polymer/v0_8/components/paper-fab/paper-fab.html b/third_party/polymer/v0_8/components/paper-fab/paper-fab.html
new file mode 100644
index 0000000000000000000000000000000000000000..09e0a849b6b494a341069a446700641b26e4730e
--- /dev/null
+++ b/third_party/polymer/v0_8/components/paper-fab/paper-fab.html
@@ -0,0 +1,172 @@
+<!--
+@license
+Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
+This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
+The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
+The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
+Code distributed by Google as part of the polymer project is also
+subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
+-->
+
+<!--
+@group Paper Elements
+
+Material Design: <a href="http://www.google.com/design/spec/components/buttons.html">Button</a>
+
+`paper-fab` is a floating action button. It contains an image placed in the center and
+comes in two sizes: regular size and a smaller size by applying the attribute `mini`. When
+the user touches the button, a ripple effect emanates from the center of the button.
+
+You may import `iron-icons` to use with this element, or provide a URL to a custom icon.
+See `iron-iconset` for more information about how to use a custom icon set.
+
+Example:
+
+ <link href="path/to/iron-icons/iron-icons.html" rel="import">
+
+ <paper-fab icon="add"></paper-fab>
+ <paper-fab mini icon="favorite"></paper-fab>
+ <paper-fab src="star.png"></paper-fab>
+
+Styling
+-------
+
+Style the button with CSS as you would a normal DOM element. If you are using the icons
+provided by `iron-icons`, the icon will inherit the foreground color of the button.
+
+ /* make a blue "cloud" button */
+ <paper-fab icon="cloud" style="color: blue;"></paper-fab>
+
+By default, the ripple is the same color as the foreground at 25% opacity. You may
+customize the color using this selector:
+
+ /* make #my-button use a blue ripple instead of foreground color */
+ #my-button::shadow #ripple {
+ color: blue;
+ }
+
+The opacity of the ripple is not customizable via CSS.
+
+@element paper-fab
+@status unstable
+-->
+
+<link rel="import" href="../polymer/polymer.html">
+<link rel="import" href="../iron-icon/iron-icon.html">
+<link rel="import" href="../iron-flex-layout/classes/iron-flex-layout.html">
+<link rel="import" href="../paper-styles/default-theme.html">
+<link rel="import" href="../paper-material/paper-material.html">
+<link rel="import" href="../paper-ripple/paper-ripple.html">
+<link rel="import" href="../paper-behaviors/paper-button-behavior.html">
+
+<style is="x-style">
+ * {
+ --paper-fab-disabled-text: #c9c9c9;
+ --paper-fab-disabled-background: var(--accent-color);
+ }
+</style>
+
+<dom-module id="paper-fab">
+ <style>
+
+ :host {
+ display: inline-block;
+ position: relative;
+ outline: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ -webkit-user-select: none;
+ user-select: none;
+ cursor: pointer;
+
+ box-sizing: border-box;
+ min-width: 0;
+ width: 56px;
+ height: 56px;
+ background: var(--accent-color);
+ color: var(--text-primary-color);
+ border-radius: 50%;
+ padding: 16px;
+
+ z-index: 0;
+
+ mixin(--paper-fab);
+ }
+
+ :host([mini]) {
+ width: 40px;
+ height: 40px;
+ padding: 8px;
+
+ mixin(--paper-fab-mini);
+ }
+
+ :host([disabled]) {
+ color: var(--paper-fab-disabled-text);
+
+ mixin(--paper-fab-disabled);
+ }
+
+ paper-material {
+ border-radius: inherit;
+ }
+ </style>
+ <template>
+ <paper-ripple></paper-ripple>
+ <paper-material class="content fit flex layout vertical center-center" elevation="[[elevation]]" animated>
+ <iron-icon id="icon" src="[[src]]" icon="[[icon]]"></iron-icon>
+ </paper-material>
+ </template>
+</dom-module>
+<script>
+ Polymer({
+ is: 'paper-fab',
+
+ enableCustomStyleProperties: true,
+
+ behaviors: [
+ Polymer.PaperButtonBehavior
+ ],
+
+ properties: {
+ /**
+ * The URL of an image for the icon. If the src property is specified,
+ * the icon property should not be.
+ *
+ * @attribute src
+ * @type string
+ * @default ''
+ */
+ src: {
+ type: String,
+ value: ''
+ },
+
+ /**
+ * Specifies the icon name or index in the set of icons available in
+ * the icon's icon set. If the icon property is specified,
+ * the src property should not be.
+ *
+ * @attribute icon
+ * @type string
+ * @default ''
+ */
+ icon: {
+ type: String,
+ value: ''
+ },
+
+ /**
+ * Set this to true to style this is a "mini" FAB.
+ *
+ * @attribute mini
+ * @type boolean
+ * @default false
+ */
+ mini: {
+ type: Boolean,
+ value: false
+ }
+ }
+ });
+</script>

Powered by Google App Engine
This is Rietveld 408576698