1.9 KB92 lines
Blame
1/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8.tooltip-creator {
9 width: fit-content;
10 height: fit-content;
11 display: flex;
12}
13
14.tooltip-creator-inline {
15 display: inline;
16 text-decoration: underline;
17}
18
19.tooltip {
20 position: absolute;
21 pointer-events: initial;
22 background-color: var(--tooltip-background);
23 color: var(--foreground);
24 border: 1px solid var(--tooltip-border);
25 padding: var(--pad);
26 z-index: 1000;
27 opacity: 0;
28 animation: fadein 0.1s forwards linear;
29 height: 100%;
30}
31@keyframes fadein {
32 0% {
33 opacity: 0%;
34 }
35 100% {
36 opacity: 100%;
37 }
38}
39
40.tooltip-arrow {
41 --arrow-height: calc(var(--pad) - 4px);
42 --arrow-half-width: calc(var(--arrow-height) / 2);
43 position: absolute;
44}
45
46.tooltip-arrow::after {
47 content: ' ';
48 position: absolute;
49 width: var(--arrow-height);
50 height: var(--arrow-height);
51 background-color: var(--tooltip-background);
52 border-right: 1px solid var(--tooltip-border);
53 border-bottom: 1px solid var(--tooltip-border);
54}
55
56.tooltip.simple-text-tooltip {
57 max-width: 250px;
58 white-space: pre-wrap;
59 word-break: break-word;
60 pointer-events: unset;
61}
62
63.tooltip-arrow-bottom::after {
64 transform: rotate(225deg);
65}
66.tooltip-arrow-top::after {
67 transform: rotate(45deg);
68}
69.tooltip-arrow-left::after {
70 transform: rotate(315deg);
71}
72.tooltip-arrow-right::after {
73 transform: rotate(135deg);
74}
75
76.tooltip-arrow-bottom {
77 left: calc(50% - var(--arrow-half-width));
78 top: calc(-1px - var(--arrow-half-width));
79}
80.tooltip-arrow-top {
81 left: calc(50% - var(--arrow-half-width));
82 bottom: calc(var(--arrow-half-width));
83}
84.tooltip-arrow-left {
85 right: calc(var(--arrow-half-width));
86 top: calc(50% - var(--arrow-half-width));
87}
88.tooltip-arrow-right {
89 left: calc(-1px - var(--arrow-half-width));
90 top: calc(50% - var(--arrow-half-width));
91}
92