button tooltip from b90e32886a019e0e55af8d8d6f289312527d2fed

This commit is contained in:
Sanster
2022-05-21 13:04:09 +08:00
committed by Qing
parent 92900933e5
commit 22834a8243
9 changed files with 56 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
$tooltip-translate: 100%;
$tooltip-margin: 1.5rem;
.info-tooltip {
&:hover:before {
content: attr(data-tooltip);
position: absolute;
background-color: var(--tooltip-bg);
color: var(--tooltip-text-color);
padding: 0.5rem;
border-radius: 0.3rem;
z-index: 2;
}
}
.info-tooltip-top {
&:hover:before {
transform: translateY(calc($tooltip-translate * -1));
margin-bottom: $tooltip-margin;
}
}
.info-tooltip-bottom {
&:hover:before {
transform: translateY($tooltip-translate);
margin-top: $tooltip-margin;
}
}