Open
Description
Describe your motivation
Visual indicators improve discoverability of tooltips. These can look for example something like this:
We don't currently have default styles for this, and doing so would be a breaking change and probably not desired in some applications, so it's up to developers to implement these indicators in their applications in the way they want.
The problem is that it's currently a bit tricky to target elements that have tooltips:
- Most components (e.g. Buttons) with tooltips can theoretically be targeted by utilizing the aria-describedby attribute with a selector like
[aria-describedby*="vaadin-tooltip"] {...}
, but it's not the most intuitive selector, and not necessarily bulletproof. - Grid cells with tooltips don't have the
aria-describedby
attribute, nor any other property that indicates the presence of a tooltip.
Describe the solution you'd like
- A state attribute automatically applied to components with tooltips (e.g.
has-tooltip
), that can be used in a selector likevaadin-button[has-tooltip] {...}
. - A cell part name automatically applied to Grid cells with tooltips (e.g.
cell-with-tooltip
) that can be used in a selector likevaadin-grid::part(cell-with-tooltip) {...}
Describe alternatives you've considered
Of course e.g. css classnames can be applied "manually" to components and Grid cells, but that's extra boilerplate code for a very simple feature.