Skip to content

Attributes / part names indicating elements with tooltip (for styling) #5094

Open
@rolfsmeds

Description

@rolfsmeds

Describe your motivation

Visual indicators improve discoverability of tooltips. These can look for example something like this:
image

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 like vaadin-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 like vaadin-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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions