• Resolved Amanda Hawkins

    (@ohamanda-1)


    Is there currently a way to add aria-hidden=true or title=description to the tags that are outputted by the Font Awesome shortcodes?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author mlwilkerson

    (@mlwilkerson)

    @ohamanda-1 No, not yet. It will pass through any extra CSS classes you add to the class attribute, but it won’t pass through any other attributes. Would you like to make that a feature request?

    In the meantime, you might experiment with whether the Auto-Accessibility feature in Kits will meet any part of your needs here. It can automatically add aria-hidden=true to the icons you use (this happens client-side, in the browser, via the JavaScript that powers the kit–not in the server-side short code logic). If you want to get a title attribute in there, then you’d need to directly encode that as HTML, like:
    <i aria-hidden="true" class="fas fa-car" title="Time to destination by car"></i>

    See also: Font Awesome documentation on accessibility.

    Thread Starter Amanda Hawkins

    (@ohamanda-1)

    Yes to feature request, especially adding a title or alt text. Thank you for this info!

    Plugin Author mlwilkerson

    (@mlwilkerson)

    Hi @ohamanda-1 plugin release 4.0.0-rc23 enhances the shortcode to support the accessibility attributes: role, title, aria-hidden, aria-label, aria-labelledby.

    If you’re using a Font Awesome Kit with Webfont/CSS, and you’ve got Auto-Accessibility enabled, then all of that magic will work simply by adding the title attribute and aria-hidden="true".

    If you’re not using Webfont/CSS not in a Kit, you can achieve similar results as our documentation shows by using those various accessibility attributes manually.

    If you’re using the SVG/JS technology–even without a kit–then simply adding the title attribute will get you auto-accessibility, since that feature is enabled by default in the SVG/JS technology.

    Thread Starter Amanda Hawkins

    (@ohamanda-1)

    This is so cool! Thank you for the update. ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Accessibility’ is closed to new replies.