Accessibility

  • role="tooltip". When the tooltip is the control's name, point the button's aria-labelledby at it; when it adds a hint, use aria-describedby. Never both, or the name is read twice.
  • WCAG 1.4.13, content on hover or focus. Dismissible: Escape hides it without moving the pointer or focus. Hoverable: the pointer can move onto it without it closing. Persistent: it stays until the pointer or focus leaves.
  • It never holds essential information: touch users and many screen reader users never see it.
  • Contrast: on-ink on ink is 16.7:1 in light and 15.9:1 in dark, and the ink bubble on paper is 16.7:1 and 15.9:1, so its edge is clear without the shadow.
  • Motion: it fades in over --k-motion-short; under prefers-reduced-motion it appears at once.