69 lines
1.9 KiB
CSS
69 lines
1.9 KiB
CSS
.bubble {
|
|
display: inline-flex;
|
|
align-items: safe center;
|
|
gap: 8px;
|
|
position: fixed;
|
|
z-index: 100;
|
|
/* Fixed-position shrink-to-fit measures only the space from `left` to the
|
|
viewport edge, so anchors near the right edge would wrap early;
|
|
max-content sizes by the label alone, capped at half the viewport. */
|
|
width: max-content;
|
|
box-sizing: border-box;
|
|
max-width: min(50vw, calc(100vw - 24px));
|
|
max-height: calc(100vh - 24px);
|
|
overflow: auto;
|
|
padding: 3px 7px;
|
|
border-radius: var(--dsw-radius-sm);
|
|
background: var(--dsw-alias-tooltip-bg);
|
|
color: var(--dsw-alias-tooltip-label);
|
|
font-size: 13px;
|
|
line-height: 20px;
|
|
white-space: pre-line;
|
|
/* Unbreakable tokens (URLs, paths) must not push past max-width. */
|
|
overflow-wrap: break-word;
|
|
pointer-events: none;
|
|
animation: tooltip-in 150ms var(--ds-ease-in-out);
|
|
}
|
|
|
|
.bubble[data-portal] { z-index: 1100; }
|
|
:global(:where(html[data-platform='darwin'])) .bubble { -webkit-app-region: no-drag; }
|
|
.bubble[data-pinned] { pointer-events: auto; }
|
|
.label { min-width: 0; }
|
|
|
|
/* A 16px keycap centered beside a 20px label has 5px of vertical clearance. */
|
|
.bubble[data-has-shortcut] { padding-inline-end: 5px; }
|
|
.bubble[data-has-shortcut]:not(:has(.label)) { padding: 3px; }
|
|
|
|
.bubble[data-side='right'],
|
|
.bubble[data-side='left'] {
|
|
transform: translateY(-50%);
|
|
}
|
|
|
|
.bubble[data-side='bottom'] {
|
|
transform: translateX(-50%);
|
|
}
|
|
|
|
.bubble[data-side='top'] {
|
|
transform: translate(-50%, -100%);
|
|
}
|
|
|
|
/* End alignment: `left` carries the anchor's right edge, so the bubble sits
|
|
fully left of it instead of centering. */
|
|
.bubble[data-side='bottom'][data-align='end'] {
|
|
transform: translateX(-100%);
|
|
}
|
|
|
|
.bubble[data-side='top'][data-align='end'] {
|
|
transform: translate(-100%, -100%);
|
|
}
|
|
|
|
@keyframes tooltip-in {
|
|
from { opacity: 0; }
|
|
}
|
|
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.bubble {
|
|
animation: none;
|
|
}
|
|
}
|