Re: [csswg-drafts] [css-ui] Standardize tooltip styling and expose as `::tooltip` (#8930)

Bit of a side track, but you kind of provided a prompt:
> Non-goals
> Tooltips with arbitrary HTML content (these can be done with the popover API)

> Instead of using a title attribute, SVG supports a <title> element […] it would be nice if in the future we could backport this element into HTML

I don't inherently have much appetite for tool tips with fully arbitrary content. At the same time, full on i18n does require more than plain text. And general text semantics do too. Drawing the line is tricky though:

0. plain text
1. plain text with a lang and dir attribute
2. ability to nest `<span>`, `<bdi>`, and `<bdo>`with different lang and dir attributes on different parts of the text
3. `<wbr>` and `<br>`?
4. also `<sub>` and `<super>`?
5. what about `<ruby>`?
6. what about `<em>`, `<strong>`, `<b>`, `<u>`, `<i>`, `<s>`, `<q>`, `<var>`, `<code>`, `<small>`, `<ins>`, `<del>`…?
7. `<math>`, `<img>`, `<svg>`…?
8. `<a>`? `<button>`?

Most of that doesn't seems _wrong_ in a tooltip, but we're quickly getting close to arbitrary content.  (The last two are starting to feel like a stretch, but just looking on this github page and hovering a username gets you tooltips with `<img>`, `<svg>`, `<a>`, and `<button>`.… Maybe they're popovers more than tooltips, but I find the limit blurry.)


Anyway, I think solving this here is probably out of scope for this issue, but it would be good to make sure that the solution we pick for this issue can scale to that too, because as @LeaVerou said, it would be good to be able to deal with:
> the use cases that require more rich tooltip content without having to deal with all the plumbing and positioning manually

-- 
GitHub Notification of comment by frivoal
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8930#issuecomment-1581771073 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 8 June 2023 01:51:34 UTC