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

Thanks for raising this issue! So as you mentioned, OpenUI is working on a [`popover=hint` and Hover Triggering Proposal](https://open-ui.org/components/popover-hint.research.explainer/) which is quite related. Having said that, there is a large class of use cases which likely don't need the full `Popover` API, and for those, something like `::tooltip` or `::title` would do the job nicely. **So I'm generally supportive.**

But it's important that the developer story is clear. To me, this seems to make the most sense:

1. The `::title`/`::tooltip` pseudo class is for the "common", "simple" use case of just wanting to set the basic styles for tooltips that arise due to the `title` attribute. Without any data to back me up, I'd venture a guess that this will solve 80% of the tooltip use cases on the Web today.
2. The new [Hint/Hover functionality being proposed](https://open-ui.org/components/popover-hint.research.explainer) is for all of the cases not handled by `::title`/`::tooltip`.

If folks are roughly onboard with that split, then in my opinion, this issue (`::title`/`::tooltip`) should have the following goals and non-goals:

### Goals:
- Allow setting basic styles for the tooltip that results from the `title` attribute.
- Support setting as many properties as possible, but perhaps not all properties. In particular, not positions.

### Non-goals for `::title` (these should be goals for `popover=hint`):
- Allow "generating" a tooltip from an element that **does not bear the `title` attribute**. That would be asking for a11y problems. It also has perf problems as discussed above.
- Allow the developer to **control the position of the tooltip** - that should continue to be managed by the UA.
- Allow the developer to add their own **"pointer/arrow"** from the tooltip to the element. This could still be auto-magically provided by the UA if desired.
- Allow the developer to control the **triggering of the tooltip**, for example setting hover time delays for showing/hiding. That is complex behavior and should continue to be managed by the UA.
- Allow the tooltip to extend **beyond the bounds of the containing window**. That is a security concern, as mentioned above, due to largely-arbitrary styling.


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


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

Received on Monday, 10 July 2023 21:53:56 UTC