| OLD | NEW |
| (Empty) |
| 1 <!-- | |
| 2 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | |
| 3 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | |
| 4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | |
| 5 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | |
| 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/PATEN
TS.txt | |
| 8 --><html><head><link rel="import" href="../polymer/polymer.html"> | |
| 9 <link rel="import" href="../neon-animation/neon-animation-runner-behavior.html"> | |
| 10 <link rel="import" href="../neon-animation/animations/fade-in-animation.html"> | |
| 11 <link rel="import" href="../neon-animation/animations/fade-out-animation.html"> | |
| 12 | |
| 13 <!-- | |
| 14 Material design: [Tooltips](https://www.google.com/design/spec/components/toolti
ps.html) | |
| 15 | |
| 16 `<paper-tooltip>` is a label that appears on hover and focus when the user | |
| 17 hovers over an element with the cursor or with the keyboard. It will be centered | |
| 18 to an anchor element specified in the `for` attribute, or, if that doesn't exist
, | |
| 19 centered to the parent node containing it. | |
| 20 | |
| 21 Example: | |
| 22 | |
| 23 <div style="display:inline-block"> | |
| 24 <button>Click me!</button> | |
| 25 <paper-tooltip>Tooltip text</paper-tooltip> | |
| 26 </div> | |
| 27 | |
| 28 <div> | |
| 29 <button id="btn">Click me!</button> | |
| 30 <paper-tooltip for="btn">Tooltip text</paper-tooltip> | |
| 31 </div> | |
| 32 | |
| 33 The tooltip can be positioned on the top|bottom|left|right of the anchor using | |
| 34 the `position` attribute. The default position is bottom. | |
| 35 | |
| 36 <paper-tooltip for="btn" position="left">Tooltip text</paper-tooltip> | |
| 37 <paper-tooltip for="btn" position="top">Tooltip text</paper-tooltip> | |
| 38 | |
| 39 ### Styling | |
| 40 | |
| 41 The following custom properties and mixins are available for styling: | |
| 42 | |
| 43 Custom property | Description | Default | |
| 44 ----------------|-------------|---------- | |
| 45 `--paper-tooltip-background` | The background color of the tooltip | `#616161` | |
| 46 `--paper-tooltip-opacity` | The opacity of the tooltip | `0.9` | |
| 47 `--paper-tooltip-text-color` | The text color of the tooltip | `white` | |
| 48 `--paper-tooltip` | Mixin applied to the tooltip | `{}` | |
| 49 | |
| 50 @group Paper Elements | |
| 51 @element paper-tooltip | |
| 52 @demo demo/index.html | |
| 53 --> | |
| 54 | |
| 55 </head><body><dom-module id="paper-tooltip"> | |
| 56 <template> | |
| 57 <style> | |
| 58 :host { | |
| 59 display: block; | |
| 60 position: absolute; | |
| 61 outline: none; | |
| 62 z-index: 1002; | |
| 63 -moz-user-select: none; | |
| 64 -ms-user-select: none; | |
| 65 -webkit-user-select: none; | |
| 66 user-select: none; | |
| 67 cursor: default; | |
| 68 } | |
| 69 | |
| 70 #tooltip { | |
| 71 display: block; | |
| 72 outline: none; | |
| 73 @apply(--paper-font-common-base); | |
| 74 font-size: 10px; | |
| 75 line-height: 1; | |
| 76 | |
| 77 background-color: var(--paper-tooltip-background, #616161); | |
| 78 opacity: var(--paper-tooltip-opacity, 0.9); | |
| 79 color: var(--paper-tooltip-text-color, white); | |
| 80 | |
| 81 padding: 8px; | |
| 82 border-radius: 2px; | |
| 83 | |
| 84 @apply(--paper-tooltip); | |
| 85 } | |
| 86 | |
| 87 /* Thanks IE 10. */ | |
| 88 .hidden { | |
| 89 display: none !important; | |
| 90 } | |
| 91 </style> | |
| 92 | |
| 93 <div id="tooltip" class="hidden"> | |
| 94 <content></content> | |
| 95 </div> | |
| 96 </template> | |
| 97 | |
| 98 </dom-module> | |
| 99 <script src="paper-tooltip-extracted.js"></script></body></html> | |
| OLD | NEW |