|
1 | 1 | .Tooltip {
|
2 |
| - background-color: var(--border-color); |
3 |
| - border-radius: 4px; |
4 |
| - font-size: 13px; |
| 2 | + --color: var(--border-color); |
| 3 | + --arrow-height: 8px; |
| 4 | + --arrow-width: 12px; |
| 5 | + |
5 | 6 | opacity: 0;
|
6 |
| - padding: 8px 10px; |
7 | 7 | transition: opacity ease-in-out;
|
8 | 8 |
|
9 |
| - &--entered { |
10 |
| - opacity: 1; |
| 9 | + &__content { |
| 10 | + background-color: var(--color); |
| 11 | + border-radius: 4px; |
| 12 | + font-size: 13px; |
| 13 | + padding: 8px 10px; |
| 14 | + text-align: center; |
11 | 15 | }
|
12 | 16 |
|
13 | 17 | &__arrow {
|
| 18 | + display: block; |
| 19 | + height: var(--arrow-height); |
14 | 20 | position: absolute;
|
15 |
| - width: 16px; |
16 |
| - height: 24px; |
| 21 | + width: var(--arrow-width); |
17 | 22 |
|
18 | 23 | &:before {
|
| 24 | + border-color: transparent; |
19 | 25 | border-style: solid;
|
20 | 26 | content: '';
|
21 |
| - display: block; |
22 |
| - height: 0; |
23 |
| - margin: auto; |
24 |
| - width: 0; |
| 27 | + position: absolute; |
25 | 28 | }
|
| 29 | + } |
| 30 | + |
| 31 | + &--entered { |
| 32 | + opacity: 1; |
| 33 | + } |
26 | 34 |
|
27 |
| - &--top { |
| 35 | + &--top { |
| 36 | + padding: var(--arrow-height) 0; |
| 37 | + |
| 38 | + .Tooltip__arrow { |
28 | 39 | bottom: 0;
|
29 |
| - height: calc(24px / 3); |
| 40 | + |
| 41 | + &:before { |
| 42 | + border-top-color: var(--color); |
| 43 | + border-width: var(--arrow-height) calc(var(--arrow-width) / 2) 0; |
| 44 | + top: 0; |
| 45 | + } |
| 46 | + } |
| 47 | + } |
| 48 | + |
| 49 | + &--right { |
| 50 | + padding: 0 var(--arrow-height); |
| 51 | + |
| 52 | + .Tooltip__arrow { |
| 53 | + height: var(--arrow-width); |
30 | 54 | left: 0;
|
31 |
| - margin-bottom: calc(-24px / 3); |
32 |
| - width: 16px; |
| 55 | + width: var(--arrow-height); |
| 56 | + |
| 57 | + &:before { |
| 58 | + border-right-color: var(--color); |
| 59 | + border-width: calc(var(--arrow-width) / 2) var(--arrow-height) calc(var(--arrow-width) / 2) 0; |
| 60 | + right: 0; |
| 61 | + } |
| 62 | + } |
| 63 | + } |
| 64 | + |
| 65 | + &--bottom { |
| 66 | + padding: var(--arrow-height) 0; |
| 67 | + |
| 68 | + .Tooltip__arrow { |
| 69 | + top: 0; |
| 70 | + |
| 71 | + &:before { |
| 72 | + border-bottom-color: var(--color); |
| 73 | + border-width: 0 calc(var(--arrow-width) / 2) var(--arrow-height); |
| 74 | + bottom: 0; |
| 75 | + } |
| 76 | + } |
| 77 | + } |
| 78 | + |
| 79 | + &--left { |
| 80 | + padding: 0 var(--arrow-height); |
| 81 | + |
| 82 | + .Tooltip__arrow { |
| 83 | + height: var(--arrow-width); |
| 84 | + right: 0; |
| 85 | + width: var(--arrow-height); |
33 | 86 |
|
34 | 87 | &:before {
|
35 |
| - border-color: var(--border-color) transparent transparent transparent; |
36 |
| - border-width: calc(24px / 3) 8px 0 8px; |
| 88 | + border-left-color: var(--color); |
| 89 | + border-width: calc(var(--arrow-width) / 2) 0 calc(var(--arrow-width) / 2) var(--arrow-height); |
| 90 | + left: 0; |
37 | 91 | }
|
38 | 92 | }
|
39 | 93 | }
|
|
0 commit comments