2018-01-01 19:46:28 +00:00
|
|
|
@import 'common/sass/variables';
|
|
|
|
@import 'common/sass/mixins';
|
|
|
|
|
|
|
|
.Tooltip {
|
2018-05-11 15:15:32 +00:00
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
2018-01-01 19:46:28 +00:00
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 50%;
|
|
|
|
width: 220px;
|
2018-06-27 04:51:42 +00:00
|
|
|
color: color(tooltip-color);
|
2018-01-26 20:08:39 +00:00
|
|
|
font-size: $font-size-small;
|
2018-01-01 19:46:28 +00:00
|
|
|
font-family: $font-family-sans-serif;
|
|
|
|
pointer-events: none;
|
|
|
|
opacity: 0;
|
|
|
|
visibility: hidden;
|
2018-05-11 15:15:32 +00:00
|
|
|
transform: translate(-50%, -100%) translateY(-$tooltip-start-distance);
|
2018-01-01 19:46:28 +00:00
|
|
|
transition-property: opacity, transform, visibility;
|
|
|
|
transition-duration: 100ms, 100ms, 0ms;
|
|
|
|
transition-delay: 0ms, 0ms, 100ms;
|
|
|
|
z-index: $zindex-tooltip;
|
|
|
|
|
|
|
|
> span {
|
|
|
|
display: inline-block;
|
2018-06-27 04:51:42 +00:00
|
|
|
background: color(tooltip-bg);
|
2018-01-26 20:08:39 +00:00
|
|
|
border-radius: 3px;
|
|
|
|
padding: 6px 10px;
|
2018-01-01 19:46:28 +00:00
|
|
|
|
|
|
|
&:after {
|
|
|
|
position: absolute;
|
|
|
|
content: '';
|
|
|
|
bottom: 0;
|
|
|
|
left: 50%;
|
|
|
|
transform: translate(-50%, 100%);
|
2018-06-27 04:51:42 +00:00
|
|
|
@include triangle($tooltip-arrow-size * 2, color(tooltip-bg), down);
|
2018-01-26 20:08:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Sizing, medium is default
|
|
|
|
&.is-size-sm {
|
|
|
|
width: 200px;
|
|
|
|
font-size: $font-size-xs;
|
|
|
|
|
|
|
|
> span {
|
|
|
|
padding: 4px 8px;
|
|
|
|
border-radius: 2px;
|
|
|
|
|
|
|
|
&:after {
|
2018-05-11 15:15:32 +00:00
|
|
|
border-width: $tooltip-arrow-size - 1;
|
2018-01-26 20:08:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.is-size-lg {
|
|
|
|
width: 240px;
|
|
|
|
font-size: $font-size-base;
|
|
|
|
|
|
|
|
> span {
|
|
|
|
padding: 8px 12px;
|
|
|
|
border-radius: 4px;
|
|
|
|
|
|
|
|
&:after {
|
2018-05-11 15:15:32 +00:00
|
|
|
border-width: $tooltip-arrow-size + 1;
|
2018-01-26 20:08:39 +00:00
|
|
|
}
|
2018-01-01 19:46:28 +00:00
|
|
|
}
|
|
|
|
}
|
2018-05-11 15:15:32 +00:00
|
|
|
|
|
|
|
// Direction, top is default
|
|
|
|
&.is-direction-left {
|
|
|
|
left: 0;
|
|
|
|
top: 50%;
|
|
|
|
justify-content: flex-end;
|
|
|
|
transform: translate(-100%, -50%) translateX(-$tooltip-start-distance);
|
|
|
|
|
|
|
|
> span:after {
|
|
|
|
bottom: 50%;
|
|
|
|
right: 0;
|
|
|
|
left: auto;
|
|
|
|
transform: translate(100%, 50%);
|
|
|
|
border-top-color: transparent;
|
2018-06-27 04:51:42 +00:00
|
|
|
border-left-color: color(tooltip-bg);
|
2018-05-11 15:15:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.is-direction-right {
|
|
|
|
left: auto;
|
|
|
|
right: 0;
|
|
|
|
top: 50%;
|
|
|
|
justify-content: flex-start;
|
|
|
|
transform: translate(100%, -50%) translateX($tooltip-start-distance);
|
|
|
|
|
|
|
|
> span:after {
|
|
|
|
bottom: 50%;
|
|
|
|
left: 0;
|
|
|
|
transform: translate(-100%, 50%);
|
|
|
|
border-top-color: transparent;
|
2018-06-27 04:51:42 +00:00
|
|
|
border-right-color: color(tooltip-bg);
|
2018-05-11 15:15:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.is-direction-bottom {
|
|
|
|
top: auto;
|
|
|
|
bottom: 0;
|
|
|
|
transform: translate(-50%, 100%) translateY($tooltip-start-distance);
|
|
|
|
|
|
|
|
> span:after {
|
|
|
|
bottom: auto;
|
|
|
|
top: 0;
|
|
|
|
transform: translate(-50%, -100%);
|
|
|
|
border-top-color: transparent;
|
2018-06-27 04:51:42 +00:00
|
|
|
border-bottom-color: color(tooltip-bg);
|
2018-05-11 15:15:32 +00:00
|
|
|
}
|
|
|
|
}
|
2018-01-01 19:46:28 +00:00
|
|
|
}
|