aboutsummaryrefslogtreecommitdiff
path: root/catapult/third_party/polymer/components/core-tooltip/core-tooltip.css
blob: aa24c39fcaaf357f9c9a056441e8cc699e332e39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/* Copyright (c) 2014 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 */

:host {
  box-sizing: border-box;
  position: relative;
  display: inline-block;
  outline: none;
}

:host(:hover:not([disabled])) .core-tooltip {
  visibility: visible !important;
}

:host([focused]) .core-tooltip {
  visibility: visible !important;
}

.core-tooltip:not(.show) {
  visibility: hidden;
}

.core-tooltip {
  position: absolute;
  font-size: 10px;
  font-weight: 500;
  padding: 8px;
  color: white;
  background-color: rgba(0, 0, 0, 0.9);
  box-sizing: border-box;
  border-radius: 3px; /* TODO: not in spec. */
  white-space: nowrap;
  line-height: 6px;
  z-index: 1002; /* TODO: this is brittle. */
  -webkit-user-select: none;
  user-select: none;
}

:host([large]) .core-tooltip {
  line-height: 14px;
  font-size: 14px;
  padding: 16px;
}

.core-tooltip.noarrow::after {
  display: none;
}

.core-tooltip::after {
  position: absolute;
  border: solid transparent;
  content: '';
  height: 0;
  width: 0;
  border-width: 4px;
}

.top {
  margin-bottom: 10px; /* TODO: not specified in spec */
  bottom: 100%;
}

.right {
  margin-left: 10px; /* TODO: not specified in spec */
  left: 100%;
}

.bottom {
  top: 100%;
  margin-top: 10px; /* TODO: not specified in spec */
}

.left {
  margin-right: 10px; /* TODO: not specified in spec */
  right: 100%;
}

.core-tooltip.bottom::after {
  bottom: 100%;
  left: calc(50% - 4px);
  border-bottom-color: rgba(0,0,0,0.8);
}

.core-tooltip.left::after {
  left: 100%;
  top: calc(50% - 4px);
  border-left-color: rgba(0,0,0,0.8);
}

.core-tooltip.top::after {
  top: 100%;
  left: calc(50% - 4px);
  border-top-color: rgba(0,0,0,0.8);
}

.core-tooltip.right::after {
  right: 100%;
  top: calc(50% - 4px);
  border-right-color: rgba(0,0,0,0.8);
}