Skip to content

[Icons] Suggestion: Provide an easy way to add a <title> element to the SVG #2966

@ThomasLandauer

Description

@ThomasLandauer

As far as I can see, using a title="" attribute on SVG's is discouraged, see e.g. https://stackoverflow.com/a/4756461/1668200 or https://css-tricks.com/svg-title-vs-html-title-attribute/

However, you're explicitly mentioning such a title attribute at https://symfony.com/bundles/ux-icons/current/index.html#accessibility:

... automatically to icons not having at least one of the following attributes: aria-label, aria-labelledby or title.

(The functionality was introduced in #1690)

The recommended way seems to be to add a <title> element as first child of the SVG:

<svg...>
    <title>My cat</title>
</svg>

So I'm suggesting to integrate an easy way to add such a <title>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    IconsRFCRFC = Request For Comments (proposals about features that you want to be discussed)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions