Tooltip.module.css 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* Visual spec mirrors deepsuite @deepseek/ui Tooltip.css (size m, no arrow),
  2. except padding tightened 6/12 -> 3/7, type 14/22 -> 13/20, radius
  3. 10 -> 8, a tooltip-bg plate,
  4. one text color across both themes (the plate stays dark in light and dark
  5. mode). Behavior (fixed positioning off the anchor rect) is local — the
  6. upstream Floating stack is intentionally not vendored. */
  7. .bubble {
  8. position: fixed;
  9. z-index: 100;
  10. /* Fixed-position shrink-to-fit measures only the space from `left` to the
  11. viewport edge, so anchors near the right edge would wrap early;
  12. max-content sizes by the label alone, capped at half the viewport. */
  13. width: max-content;
  14. max-width: 50vw;
  15. padding: 3px 7px;
  16. border-radius: 8px;
  17. background: var(--dsw-alias-tooltip-bg);
  18. color: var(--dsw-static-neutral-bluish-00);
  19. font-size: 13px;
  20. line-height: 20px;
  21. white-space: pre-line;
  22. /* Unbreakable tokens (URLs, paths) must not push past max-width. */
  23. overflow-wrap: break-word;
  24. pointer-events: none;
  25. animation: tooltip-in 150ms var(--ds-ease-in-out);
  26. }
  27. .bubble[data-side='right'] {
  28. transform: translateY(-50%);
  29. }
  30. .bubble[data-side='bottom'] {
  31. transform: translateX(-50%);
  32. }
  33. .bubble[data-side='top'] {
  34. transform: translate(-50%, -100%);
  35. }
  36. @keyframes tooltip-in {
  37. from { opacity: 0; }
  38. }
  39. @media (prefers-reduced-motion: reduce) {
  40. .bubble {
  41. animation: none;
  42. }
  43. }