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