fleet/frontend/components/TooltipWrapper/_styles.scss
2022-09-02 17:05:07 -05:00

81 lines
1.6 KiB
SCSS

.component__tooltip-wrapper {
display: inline-flex;
position: relative;
cursor: help;
&:hover {
.component__tooltip-wrapper__tip-text {
visibility: visible;
opacity: 1;
}
}
&__element {
position: static;
display: inline; // treat like a span but allow other tags as children
}
&__underline {
position: absolute;
top: 0;
left: 0;
bottom: 0;
&::before {
content: attr(data-text);
opacity: 0;
visibility: hidden;
}
&::after {
content: "";
width: 100%;
height: 100%;
position: absolute;
bottom: -2px;
left: 0;
border-bottom: 1px dashed $ui-fleet-black-50;
}
}
&__tip-text {
width: max-content;
max-width: 341px;
padding: 12px;
color: $core-white;
background-color: $core-fleet-blue;
font-weight: $regular;
font-size: $xx-small;
border-radius: 4px;
position: absolute;
top: calc(100% + 6px);
left: 0;
box-sizing: border-box;
z-index: 99; // not more than the site nav
visibility: hidden;
opacity: 0;
transition: opacity 0.3s ease;
line-height: 1.375;
// invisible block to cover space so
// hover state can continue from text to bubble
&::before {
content: "";
width: 100%;
height: 6px;
position: absolute;
top: -6px;
left: 0;
}
p {
margin: 0;
}
}
&[data-position="top"] {
.component__tooltip-wrapper__tip-text {
top: auto;
bottom: 100%;
&::before {
display: none;
}
}
}
}