85 lines
2.1 KiB
CSS
85 lines
2.1 KiB
CSS
/* Adapted from HeroUI ce90ea3. Copyright 2025 NextUI Inc.
|
|
* Apache-2.0; see third-party/HEROUI-LICENSE. hv- namespace and Vue/Reka adapters. */
|
|
/* Tooltip component styles */
|
|
|
|
/* Base tooltip styles */
|
|
.hv-tooltip {
|
|
@apply max-w-xs origin-(--reka-popper-transform-origin) bg-overlay p-2 text-xs break-all;
|
|
border-radius: min(32px, var(--radius-xl));
|
|
box-shadow: var(--overlay-shadow);
|
|
|
|
/* Entering animations */
|
|
&[data-entering="true"] {
|
|
@apply animate-in duration-150 ease-smooth fade-in-0 zoom-in-90;
|
|
|
|
/* Placement-specific translations */
|
|
&[data-side="top"] {
|
|
@apply slide-in-from-bottom-1;
|
|
}
|
|
|
|
&[data-side="bottom"] {
|
|
@apply slide-in-from-top-1;
|
|
}
|
|
|
|
&[data-side="left"] {
|
|
@apply slide-in-from-right-1;
|
|
}
|
|
|
|
&[data-side="right"] {
|
|
@apply slide-in-from-left-1;
|
|
}
|
|
}
|
|
|
|
/* Exiting animations */
|
|
&[data-exiting="true"] {
|
|
@apply animate-out duration-100 ease-smooth zoom-out-95 fade-out;
|
|
/* Stays non-interactive while closing, even if the exit animation is interrupted. */
|
|
@apply pointer-events-none;
|
|
}
|
|
|
|
&[data-exiting="true"],
|
|
&[data-entering="true"] {
|
|
@apply transition-[opacity,transform] will-change-[opacity,transform];
|
|
}
|
|
|
|
/* Arrow styling */
|
|
& [data-slot="overlay-arrow"] {
|
|
@apply stroke-border/40;
|
|
fill: var(--overlay);
|
|
}
|
|
}
|
|
|
|
/* Tooltip trigger */
|
|
.hv-tooltip__trigger {
|
|
@apply inline-block;
|
|
|
|
/**
|
|
* Transitions
|
|
* CRITICAL: motion-reduce must be AFTER transition for correct override specificity
|
|
*/
|
|
transition:
|
|
color 150ms var(--ease-smooth),
|
|
background-color 150ms var(--ease-smooth),
|
|
box-shadow 150ms var(--ease-out);
|
|
@apply motion-reduce:transition-none;
|
|
|
|
&:focus-visible:not([data-focused]),
|
|
&[data-focus-visible="true"] {
|
|
@apply status-focused;
|
|
}
|
|
}
|
|
|
|
/* Reka owns an inline pointer-events rule; exiting surfaces must stay inactive. */
|
|
.hv-tooltip[data-exiting="true"] {
|
|
pointer-events: none !important;
|
|
}
|
|
|
|
/* React Aria supplies this stacking level inline; Reka reads it from Content. */
|
|
.hv-tooltip {
|
|
z-index: var(--z-index-overlay);
|
|
}
|
|
|
|
.hv-tooltip__trigger.hv-button {
|
|
display: inline-flex;
|
|
}
|