2020-06-19 11:36:49 +01:00
|
|
|
@import "../css/_variables";
|
2020-09-26 02:48:45 +05:30
|
|
|
.excalidraw {
|
|
|
|
.Tooltip {
|
|
|
|
position: relative;
|
|
|
|
}
|
2020-06-19 11:36:49 +01:00
|
|
|
|
2020-09-26 02:48:45 +05:30
|
|
|
.Tooltip__label {
|
|
|
|
--arrow-size: 4px;
|
|
|
|
visibility: hidden;
|
|
|
|
background: $oc-black;
|
|
|
|
color: $oc-white;
|
|
|
|
text-align: center;
|
2020-12-14 18:54:54 +05:30
|
|
|
border-radius: 6px;
|
|
|
|
padding: 8px;
|
2020-06-19 11:36:49 +01:00
|
|
|
position: absolute;
|
2020-09-26 02:48:45 +05:30
|
|
|
z-index: 10;
|
2020-12-14 18:54:54 +05:30
|
|
|
font-size: 13px;
|
2020-09-26 02:48:45 +05:30
|
|
|
line-height: 1.5;
|
2020-12-14 18:54:54 +05:30
|
|
|
font-weight: 500;
|
2020-09-26 02:48:45 +05:30
|
|
|
// extra pixel offset for unknown reasons
|
2020-12-14 18:54:54 +05:30
|
|
|
left: calc(50% + var(--arrow-size) / 2 - 1px);
|
|
|
|
transform: translateX(-50%);
|
2020-09-26 02:48:45 +05:30
|
|
|
word-wrap: break-word;
|
|
|
|
|
|
|
|
&::after {
|
|
|
|
content: "";
|
|
|
|
border: var(--arrow-size) solid transparent;
|
|
|
|
position: absolute;
|
|
|
|
left: calc(50% - var(--arrow-size));
|
|
|
|
}
|
2020-12-14 18:54:54 +05:30
|
|
|
|
|
|
|
&--above {
|
|
|
|
bottom: calc(100% + var(--arrow-size) + 3px);
|
|
|
|
|
|
|
|
&::after {
|
|
|
|
border-top-color: $oc-black;
|
|
|
|
top: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&--below {
|
|
|
|
top: calc(100% + var(--arrow-size) + 3px);
|
|
|
|
|
|
|
|
&::after {
|
|
|
|
border-bottom-color: $oc-black;
|
|
|
|
bottom: 100%;
|
|
|
|
}
|
|
|
|
}
|
2020-06-19 11:36:49 +01:00
|
|
|
}
|
|
|
|
|
2020-09-26 02:48:45 +05:30
|
|
|
// the following 3 rules ensure that the tooltip doesn't show (nor affect
|
|
|
|
// the cursor) when you drag over when you draw on canvas, but at the same
|
|
|
|
// time it still works when clicking on the link/shield
|
2020-12-14 18:54:54 +05:30
|
|
|
|
|
|
|
body:active & .Tooltip:not(:hover) {
|
2020-09-26 02:48:45 +05:30
|
|
|
pointer-events: none;
|
|
|
|
}
|
2020-06-19 11:36:49 +01:00
|
|
|
|
2020-12-14 18:54:54 +05:30
|
|
|
body:not(:active) & .Tooltip:hover .Tooltip__label {
|
2020-09-26 02:48:45 +05:30
|
|
|
visibility: visible;
|
|
|
|
}
|
2020-06-19 11:36:49 +01:00
|
|
|
|
2020-09-26 02:48:45 +05:30
|
|
|
.Tooltip__label:hover {
|
|
|
|
visibility: visible;
|
|
|
|
}
|
2020-06-19 11:36:49 +01:00
|
|
|
}
|