2019-05-06 12:04:39 +08:00
|
|
|
@import '../../style/themes/index';
|
2018-12-07 16:17:45 +08:00
|
|
|
@import '../../style/mixins/index';
|
2015-06-09 16:40:16 +08:00
|
|
|
|
2018-12-07 16:17:45 +08:00
|
|
|
@tooltip-prefix-cls: ~'@{ant-prefix}-tooltip';
|
2015-06-09 16:40:16 +08:00
|
|
|
|
2019-08-02 14:10:18 +08:00
|
|
|
@tooltip-arrow-shadow-width: 3px;
|
|
|
|
|
|
|
|
@tooltip-arrow-rotate-width: sqrt(@tooltip-arrow-width * @tooltip-arrow-width * 2) +
|
|
|
|
@tooltip-arrow-shadow-width * 2;
|
|
|
|
|
|
|
|
@tooltip-arrow-offset-vertical: 5px; // 8 - 3px
|
|
|
|
@tooltip-arrow-offset-horizontal: 13px; // 16 - 3px
|
|
|
|
|
2015-06-09 16:40:16 +08:00
|
|
|
// Base class
|
2015-08-20 16:55:42 +08:00
|
|
|
.@{tooltip-prefix-cls} {
|
2020-12-22 11:08:12 +08:00
|
|
|
.reset-component();
|
2019-04-15 10:52:00 +08:00
|
|
|
|
2015-06-09 16:40:16 +08:00
|
|
|
position: absolute;
|
2016-03-28 16:01:37 +08:00
|
|
|
z-index: @zindex-tooltip;
|
2015-06-09 16:40:16 +08:00
|
|
|
display: block;
|
2021-06-02 18:13:03 +08:00
|
|
|
width: max-content;
|
2022-03-10 19:47:16 +08:00
|
|
|
width: intrinsic;
|
2018-06-27 11:26:19 +08:00
|
|
|
max-width: @tooltip-max-width;
|
2019-02-15 10:48:07 +08:00
|
|
|
visibility: visible;
|
2015-06-17 16:58:13 +08:00
|
|
|
|
2015-06-15 21:18:08 +08:00
|
|
|
&-hidden {
|
|
|
|
display: none;
|
|
|
|
}
|
2015-06-09 16:40:16 +08:00
|
|
|
|
2015-11-26 19:32:55 +08:00
|
|
|
&-placement-top,
|
|
|
|
&-placement-topLeft,
|
|
|
|
&-placement-topRight {
|
2017-05-13 15:07:01 +08:00
|
|
|
padding-bottom: @tooltip-distance;
|
2015-11-03 13:50:36 +08:00
|
|
|
}
|
2019-08-02 14:10:18 +08:00
|
|
|
|
2015-11-26 19:32:55 +08:00
|
|
|
&-placement-right,
|
|
|
|
&-placement-rightTop,
|
|
|
|
&-placement-rightBottom {
|
2017-05-13 15:07:01 +08:00
|
|
|
padding-left: @tooltip-distance;
|
2015-11-03 13:50:36 +08:00
|
|
|
}
|
2019-08-02 14:10:18 +08:00
|
|
|
|
2015-11-26 19:32:55 +08:00
|
|
|
&-placement-bottom,
|
|
|
|
&-placement-bottomLeft,
|
|
|
|
&-placement-bottomRight {
|
2017-05-13 15:07:01 +08:00
|
|
|
padding-top: @tooltip-distance;
|
2015-11-03 13:50:36 +08:00
|
|
|
}
|
2019-08-02 14:10:18 +08:00
|
|
|
|
2015-11-26 19:32:55 +08:00
|
|
|
&-placement-left,
|
|
|
|
&-placement-leftTop,
|
|
|
|
&-placement-leftBottom {
|
2017-05-13 15:07:01 +08:00
|
|
|
padding-right: @tooltip-distance;
|
2015-11-03 13:50:36 +08:00
|
|
|
}
|
2015-06-09 16:40:16 +08:00
|
|
|
|
2017-11-29 21:00:16 +08:00
|
|
|
// Wrapper for the tooltip content
|
|
|
|
&-inner {
|
2019-02-15 10:48:07 +08:00
|
|
|
min-width: 30px;
|
|
|
|
min-height: 32px;
|
2017-11-29 21:00:16 +08:00
|
|
|
padding: 6px 8px;
|
|
|
|
color: @tooltip-color;
|
|
|
|
text-align: left;
|
|
|
|
text-decoration: none;
|
2019-02-15 10:48:07 +08:00
|
|
|
word-wrap: break-word;
|
2017-11-29 21:00:16 +08:00
|
|
|
background-color: @tooltip-bg;
|
|
|
|
border-radius: @border-radius-base;
|
|
|
|
box-shadow: @box-shadow-base;
|
|
|
|
}
|
2015-06-09 16:40:16 +08:00
|
|
|
|
2017-11-29 21:00:16 +08:00
|
|
|
// Arrows
|
|
|
|
&-arrow {
|
|
|
|
position: absolute;
|
2019-06-25 11:15:33 +08:00
|
|
|
display: block;
|
2019-08-02 14:10:18 +08:00
|
|
|
width: @tooltip-arrow-rotate-width;
|
|
|
|
height: @tooltip-arrow-rotate-width;
|
|
|
|
overflow: hidden;
|
2019-08-02 18:21:24 +08:00
|
|
|
background: transparent;
|
2019-08-02 14:10:18 +08:00
|
|
|
pointer-events: none;
|
|
|
|
|
2020-05-25 18:59:00 +08:00
|
|
|
&-content {
|
2022-02-08 09:52:33 +08:00
|
|
|
--antd-arrow-background-color: @tooltip-bg;
|
|
|
|
|
2019-08-02 18:21:24 +08:00
|
|
|
position: absolute;
|
2019-08-02 14:10:18 +08:00
|
|
|
top: 0;
|
2019-08-02 18:21:24 +08:00
|
|
|
right: 0;
|
2019-08-02 14:10:18 +08:00
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
2019-08-02 18:21:24 +08:00
|
|
|
display: block;
|
|
|
|
width: @tooltip-arrow-width;
|
|
|
|
height: @tooltip-arrow-width;
|
|
|
|
margin: auto;
|
2022-02-08 09:52:33 +08:00
|
|
|
background-color: transparent;
|
2019-08-02 18:21:24 +08:00
|
|
|
content: '';
|
2019-08-02 14:10:18 +08:00
|
|
|
pointer-events: auto;
|
2022-02-08 09:52:33 +08:00
|
|
|
.roundedArrow(@tooltip-arrow-width, 5px);
|
2019-08-02 14:10:18 +08:00
|
|
|
}
|
2017-11-29 21:00:16 +08:00
|
|
|
}
|
2015-06-09 16:40:16 +08:00
|
|
|
|
2015-11-03 13:50:36 +08:00
|
|
|
&-placement-top &-arrow,
|
|
|
|
&-placement-topLeft &-arrow,
|
|
|
|
&-placement-topRight &-arrow {
|
2022-02-08 09:52:33 +08:00
|
|
|
bottom: @tooltip-distance - @tooltip-arrow-rotate-width + 0.24px;
|
2019-08-02 14:10:18 +08:00
|
|
|
|
2020-05-25 18:59:00 +08:00
|
|
|
&-content {
|
2019-08-02 14:10:18 +08:00
|
|
|
box-shadow: @tooltip-arrow-shadow-width @tooltip-arrow-shadow-width 7px fade(@black, 7%);
|
2020-12-29 16:27:49 +08:00
|
|
|
transform: translateY((-@tooltip-arrow-rotate-width / 2)) rotate(45deg);
|
2019-08-02 14:10:18 +08:00
|
|
|
}
|
2015-06-09 16:40:16 +08:00
|
|
|
}
|
2015-11-03 13:50:36 +08:00
|
|
|
|
|
|
|
&-placement-top &-arrow {
|
|
|
|
left: 50%;
|
2019-08-02 14:10:18 +08:00
|
|
|
transform: translateX(-50%);
|
2015-11-03 13:50:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-placement-topLeft &-arrow {
|
2019-08-02 14:10:18 +08:00
|
|
|
left: @tooltip-arrow-offset-horizontal;
|
2015-11-03 13:50:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-placement-topRight &-arrow {
|
2019-08-02 14:10:18 +08:00
|
|
|
right: @tooltip-arrow-offset-horizontal;
|
2015-11-03 13:50:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-placement-right &-arrow,
|
|
|
|
&-placement-rightTop &-arrow,
|
|
|
|
&-placement-rightBottom &-arrow {
|
2022-02-08 09:52:33 +08:00
|
|
|
left: @tooltip-distance - @tooltip-arrow-rotate-width + 0.1px;
|
2019-08-02 14:10:18 +08:00
|
|
|
|
2020-05-25 18:59:00 +08:00
|
|
|
&-content {
|
2019-08-02 14:10:18 +08:00
|
|
|
box-shadow: -@tooltip-arrow-shadow-width @tooltip-arrow-shadow-width 7px fade(@black, 7%);
|
2022-02-08 09:52:33 +08:00
|
|
|
transform: translateX((@tooltip-arrow-rotate-width / 2)) rotate(135deg);
|
2019-08-02 14:10:18 +08:00
|
|
|
}
|
2015-06-09 16:40:16 +08:00
|
|
|
}
|
2015-11-03 13:50:36 +08:00
|
|
|
|
|
|
|
&-placement-right &-arrow {
|
2015-06-09 16:40:16 +08:00
|
|
|
top: 50%;
|
2019-08-02 14:10:18 +08:00
|
|
|
transform: translateY(-50%);
|
2015-11-03 13:50:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-placement-rightTop &-arrow {
|
2019-08-02 14:10:18 +08:00
|
|
|
top: @tooltip-arrow-offset-vertical;
|
2015-11-03 13:50:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-placement-rightBottom &-arrow {
|
2019-08-02 14:10:18 +08:00
|
|
|
bottom: @tooltip-arrow-offset-vertical;
|
2015-11-03 13:50:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-placement-left &-arrow,
|
|
|
|
&-placement-leftTop &-arrow,
|
|
|
|
&-placement-leftBottom &-arrow {
|
2022-02-08 09:52:33 +08:00
|
|
|
right: @tooltip-distance - @tooltip-arrow-rotate-width + 0.08px;
|
2019-08-02 14:10:18 +08:00
|
|
|
|
2020-05-25 18:59:00 +08:00
|
|
|
&-content {
|
2019-08-02 14:10:18 +08:00
|
|
|
box-shadow: @tooltip-arrow-shadow-width -@tooltip-arrow-shadow-width 7px fade(@black, 7%);
|
2022-02-08 09:52:33 +08:00
|
|
|
transform: translateX((-@tooltip-arrow-rotate-width / 2)) rotate(315deg);
|
2019-08-02 14:10:18 +08:00
|
|
|
}
|
2015-06-09 16:40:16 +08:00
|
|
|
}
|
2015-11-03 13:50:36 +08:00
|
|
|
|
|
|
|
&-placement-left &-arrow {
|
|
|
|
top: 50%;
|
2019-08-02 14:10:18 +08:00
|
|
|
transform: translateY(-50%);
|
2015-11-03 13:50:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-placement-leftTop &-arrow {
|
2019-08-02 14:10:18 +08:00
|
|
|
top: @tooltip-arrow-offset-vertical;
|
2015-11-03 13:50:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-placement-leftBottom &-arrow {
|
2019-08-02 14:10:18 +08:00
|
|
|
bottom: @tooltip-arrow-offset-vertical;
|
2015-11-03 13:50:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-placement-bottom &-arrow,
|
|
|
|
&-placement-bottomLeft &-arrow,
|
|
|
|
&-placement-bottomRight &-arrow {
|
2022-02-08 09:52:33 +08:00
|
|
|
top: @tooltip-distance - @tooltip-arrow-rotate-width + 0.1px;
|
2019-08-02 14:10:18 +08:00
|
|
|
|
2020-05-25 18:59:00 +08:00
|
|
|
&-content {
|
2019-08-02 14:10:18 +08:00
|
|
|
box-shadow: -@tooltip-arrow-shadow-width -@tooltip-arrow-shadow-width 7px fade(@black, 7%);
|
2022-02-08 09:52:33 +08:00
|
|
|
transform: translateY((@tooltip-arrow-rotate-width / 2)) rotate(225deg);
|
2019-08-02 14:10:18 +08:00
|
|
|
}
|
2015-06-09 16:40:16 +08:00
|
|
|
}
|
2015-11-03 13:50:36 +08:00
|
|
|
|
|
|
|
&-placement-bottom &-arrow {
|
|
|
|
left: 50%;
|
2019-08-02 14:10:18 +08:00
|
|
|
transform: translateX(-50%);
|
2015-11-03 13:50:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-placement-bottomLeft &-arrow {
|
2019-08-02 14:10:18 +08:00
|
|
|
left: @tooltip-arrow-offset-horizontal;
|
2015-11-03 13:50:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-placement-bottomRight &-arrow {
|
2019-08-02 14:10:18 +08:00
|
|
|
right: @tooltip-arrow-offset-horizontal;
|
2015-11-03 13:50:36 +08:00
|
|
|
}
|
2015-06-09 16:40:16 +08:00
|
|
|
}
|
2020-03-18 12:54:30 +08:00
|
|
|
|
2020-05-25 18:59:00 +08:00
|
|
|
.generator-tooltip-preset-color(@i: length(@preset-colors)) when (@i > 0) {
|
|
|
|
.generator-tooltip-preset-color(@i - 1);
|
|
|
|
@color: extract(@preset-colors, @i);
|
|
|
|
@lightColor: '@{color}-6';
|
|
|
|
.@{tooltip-prefix-cls}-@{color} {
|
|
|
|
.@{tooltip-prefix-cls}-inner {
|
|
|
|
background-color: @@lightColor;
|
|
|
|
}
|
|
|
|
.@{tooltip-prefix-cls}-arrow {
|
2022-02-08 09:52:33 +08:00
|
|
|
&-content::before {
|
2020-05-25 18:59:00 +08:00
|
|
|
background-color: @@lightColor;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.generator-tooltip-preset-color();
|
|
|
|
|
2020-03-23 10:57:37 +08:00
|
|
|
@import './rtl';
|