From ba2bb3a5fded4155f90e93c885e31bbe95748202 Mon Sep 17 00:00:00 2001 From: thepaperpilot <thepaperpilot@gmail.com> Date: Sat, 23 Apr 2022 21:23:51 -0500 Subject: [PATCH] Fixed tooltips' classes and style props --- src/features/tooltips/Tooltip.vue | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/features/tooltips/Tooltip.vue b/src/features/tooltips/Tooltip.vue index 133c139..618d5b3 100644 --- a/src/features/tooltips/Tooltip.vue +++ b/src/features/tooltips/Tooltip.vue @@ -1,11 +1,10 @@ <template> <div class="tooltip-container" - :class="{ shown: isShown, ...unref(classes) }" + :class="{ shown: isShown }" @mouseenter="isHovered = true" @mouseleave="isHovered = false" @click.capture="togglePinned" - :style="unref(style)" > <slot /> <component v-if="elementComp" :is="elementComp" /> @@ -17,12 +16,16 @@ top: unref(direction) === TooltipDirection.UP, left: unref(direction) === TooltipDirection.LEFT, right: unref(direction) === TooltipDirection.RIGHT, - bottom: unref(direction) === TooltipDirection.DOWN - }" - :style="{ - '--xoffset': unref(xoffset) || '0px', - '--yoffset': unref(yoffset) || '0px' + bottom: unref(direction) === TooltipDirection.DOWN, + ...unref(classes) }" + :style="[ + { + '--xoffset': unref(xoffset) || '0px', + '--yoffset': unref(yoffset) || '0px' + }, + unref(style) ?? {} + ]" > <span v-if="showPin" class="material-icons pinned">push_pin</span> <component v-if="comp" :is="comp" /> @@ -142,6 +145,10 @@ export default defineComponent({ word-break: break-word; } +.tooltip :deep(hr) { + margin: var(--feature-margin) 0; +} + .shown { z-index: 10; }