Make WordPress Core


Ignore:
Timestamp:
09/28/2025 11:38:57 PM (7 months ago)
Author:
joedolson
Message:

A11y: Ensure icons are not spoken by screen readers.

For all CSS generated icons across core, either add aria-hidden="true" to the HTML wrapper or set the generated content alternative to an empty string in the CSS using the alternative text specification for CSS generated content.

Props afercia, joedolson, cheffheid, jhabdas.
Fixes #40428.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/qunit/index.html

    r60516 r60806  
    997997    <script type="text/html" id="tmpl-media-modal">
    998998        <div class="media-modal wp-core-ui">
    999             <button type="button" class="media-modal-close"><span class="media-modal-icon"><span class="screen-reader-text">Close media panel</span></span></button>
     999            <button type="button" class="media-modal-close"><span class="media-modal-icon" aria-hidden="true"></span><span class="screen-reader-text">Close media panel</span></button>
    10001000            <div class="media-modal-content"></div>
    10011001        </div>
     
    12601260            </div>
    12611261            <# if ( data.buttons.close ) { #>
    1262                 <button type="button" class="button-link attachment-close media-modal-icon"><span class="screen-reader-text">Remove</span></button>
     1262                <button type="button" class="button-link attachment-close"><span class="media-modal-icon" aria-hidden="true"></span></span><span class="screen-reader-text">Remove</span></button>
    12631263            <# } #>
    12641264        </div>
    12651265        <# if ( data.buttons.check ) { #>
    1266             <button type="button" class="check" tabindex="-1"><span class="media-modal-icon"></span><span class="screen-reader-text">Deselect</span></button>
     1266            <button type="button" class="check" tabindex="-1"><span class="media-modal-icon" aria-hidden="true"></span><span class="screen-reader-text">Deselect</span></button>
    12671267        <# } #>
    12681268        <#
Note: See TracChangeset for help on using the changeset viewer.