|
19 | 19 | z-index: @zindex-tooltip;
|
20 | 20 | display: block;
|
21 | 21 | width: max-content;
|
| 22 | + width: intrinsic; |
22 | 23 | max-width: @tooltip-max-width;
|
23 | 24 | visibility: visible;
|
24 | 25 |
|
| 26 | + &-content { |
| 27 | + position: relative; |
| 28 | + } |
| 29 | + |
25 | 30 | &-hidden {
|
26 | 31 | display: none;
|
27 | 32 | }
|
|
60 | 65 | text-decoration: none;
|
61 | 66 | word-wrap: break-word;
|
62 | 67 | background-color: @tooltip-bg;
|
63 |
| - border-radius: @border-radius-base; |
| 68 | + border-radius: @tooltip-border-radius; |
64 | 69 | box-shadow: @box-shadow-base;
|
65 | 70 | }
|
66 | 71 |
|
67 | 72 | // Arrows
|
68 | 73 | &-arrow {
|
69 | 74 | position: absolute;
|
| 75 | + z-index: 2; |
70 | 76 | display: block;
|
71 | 77 | width: @tooltip-arrow-rotate-width;
|
72 | 78 | height: @tooltip-arrow-rotate-width;
|
|
75 | 81 | pointer-events: none;
|
76 | 82 |
|
77 | 83 | &-content {
|
| 84 | + // Use linear gradient to mix box shadow of tooltip inner |
| 85 | + --antd-arrow-background-color: linear-gradient( |
| 86 | + to right bottom, |
| 87 | + fadeout(@tooltip-bg, 10%), |
| 88 | + @tooltip-bg |
| 89 | + ); |
| 90 | + |
78 | 91 | position: absolute;
|
79 | 92 | top: 0;
|
80 | 93 | right: 0;
|
|
84 | 97 | width: @tooltip-arrow-width;
|
85 | 98 | height: @tooltip-arrow-width;
|
86 | 99 | margin: auto;
|
87 |
| - background-color: @tooltip-bg; |
| 100 | + background-color: transparent; |
88 | 101 | content: '';
|
89 | 102 | pointer-events: auto;
|
| 103 | + .roundedArrow(@tooltip-arrow-width, 5px); |
90 | 104 | }
|
91 | 105 | }
|
92 | 106 |
|
93 | 107 | &-placement-top &-arrow,
|
94 | 108 | &-placement-topLeft &-arrow,
|
95 | 109 | &-placement-topRight &-arrow {
|
96 |
| - bottom: @tooltip-distance - @tooltip-arrow-rotate-width; |
| 110 | + bottom: 0; |
| 111 | + transform: translateY(100%); |
97 | 112 |
|
98 | 113 | &-content {
|
99 | 114 | box-shadow: @tooltip-arrow-shadow-width @tooltip-arrow-shadow-width 7px fade(@black, 7%);
|
|
103 | 118 |
|
104 | 119 | &-placement-top &-arrow {
|
105 | 120 | left: 50%;
|
106 |
| - transform: translateX(-50%); |
| 121 | + transform: translateY(100%) translateX(-50%); |
107 | 122 | }
|
108 | 123 |
|
109 | 124 | &-placement-topLeft &-arrow {
|
|
117 | 132 | &-placement-right &-arrow,
|
118 | 133 | &-placement-rightTop &-arrow,
|
119 | 134 | &-placement-rightBottom &-arrow {
|
120 |
| - left: @tooltip-distance - @tooltip-arrow-rotate-width; |
| 135 | + left: 0; |
| 136 | + transform: translateX(-100%); |
121 | 137 |
|
122 | 138 | &-content {
|
123 | 139 | box-shadow: -@tooltip-arrow-shadow-width @tooltip-arrow-shadow-width 7px fade(@black, 7%);
|
124 |
| - transform: translateX((@tooltip-arrow-rotate-width / 2)) rotate(45deg); |
| 140 | + transform: translateX((@tooltip-arrow-rotate-width / 2)) rotate(135deg); |
125 | 141 | }
|
126 | 142 | }
|
127 | 143 |
|
128 | 144 | &-placement-right &-arrow {
|
129 | 145 | top: 50%;
|
130 |
| - transform: translateY(-50%); |
| 146 | + transform: translateX(-100%) translateY(-50%); |
131 | 147 | }
|
132 | 148 |
|
133 | 149 | &-placement-rightTop &-arrow {
|
|
141 | 157 | &-placement-left &-arrow,
|
142 | 158 | &-placement-leftTop &-arrow,
|
143 | 159 | &-placement-leftBottom &-arrow {
|
144 |
| - right: @tooltip-distance - @tooltip-arrow-rotate-width; |
| 160 | + right: 0; |
| 161 | + transform: translateX(100%); |
145 | 162 |
|
146 | 163 | &-content {
|
147 | 164 | box-shadow: @tooltip-arrow-shadow-width -@tooltip-arrow-shadow-width 7px fade(@black, 7%);
|
148 |
| - transform: translateX((-@tooltip-arrow-rotate-width / 2)) rotate(45deg); |
| 165 | + transform: translateX((-@tooltip-arrow-rotate-width / 2)) rotate(315deg); |
149 | 166 | }
|
150 | 167 | }
|
151 | 168 |
|
152 | 169 | &-placement-left &-arrow {
|
153 | 170 | top: 50%;
|
154 |
| - transform: translateY(-50%); |
| 171 | + transform: translateX(100%) translateY(-50%); |
155 | 172 | }
|
156 | 173 |
|
157 | 174 | &-placement-leftTop &-arrow {
|
|
165 | 182 | &-placement-bottom &-arrow,
|
166 | 183 | &-placement-bottomLeft &-arrow,
|
167 | 184 | &-placement-bottomRight &-arrow {
|
168 |
| - top: @tooltip-distance - @tooltip-arrow-rotate-width; |
| 185 | + top: 0; |
| 186 | + transform: translateY(-100%); |
169 | 187 |
|
170 | 188 | &-content {
|
171 | 189 | box-shadow: -@tooltip-arrow-shadow-width -@tooltip-arrow-shadow-width 7px fade(@black, 7%);
|
172 |
| - transform: translateY((@tooltip-arrow-rotate-width / 2)) rotate(45deg); |
| 190 | + transform: translateY((@tooltip-arrow-rotate-width / 2)) rotate(225deg); |
173 | 191 | }
|
174 | 192 | }
|
175 | 193 |
|
176 | 194 | &-placement-bottom &-arrow {
|
177 | 195 | left: 50%;
|
178 |
| - transform: translateX(-50%); |
| 196 | + transform: translateY(-100%) translateX(-50%); |
179 | 197 | }
|
180 | 198 |
|
181 | 199 | &-placement-bottomLeft &-arrow {
|
|
196 | 214 | background-color: @@lightColor;
|
197 | 215 | }
|
198 | 216 | .@{tooltip-prefix-cls}-arrow {
|
199 |
| - &-content { |
200 |
| - background-color: @@lightColor; |
| 217 | + &-content::before { |
| 218 | + background: @@lightColor; |
201 | 219 | }
|
202 | 220 | }
|
203 | 221 | }
|
|
0 commit comments