Skip to content

Commit

Permalink
Merge pull request #2074 from the-events-calendar/fix/TEC-5019-5020-A…
Browse files Browse the repository at this point in the history
…11y-on-SVG-icons

Add aria-hidden="true" on SVG icons
  • Loading branch information
pattihis authored Apr 22, 2024
2 parents b442247 + 00c9e0e commit 63c562d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

= [TBD] TBD =

* Tweak - Add `aria-hidden="true"` to icons so screen readers ignore it. [TEC-5019]
* Tweak - Updated our `query-string` javascript library to version 6.12. [TEC-5075]
* Fix - Add dir/filename of `event-automator` in the Plugins_API to fix CTA button text/links in the Help section. [TEC-5071]

Expand Down
3 changes: 2 additions & 1 deletion src/views/v2/components/icons/arrow-right.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
* @version 4.12.14
*
*/

$svg_classes = [ 'tribe-common-c-svgicon', 'tribe-common-c-svgicon--arrow-right' ];

if ( ! empty( $classes ) ) {
$svg_classes = array_merge( $svg_classes, $classes );
}
?>
<svg <?php tribe_classes( $svg_classes ); ?> viewBox="0 0 22 19" xmlns="http://www.w3.org/2000/svg"><path d="M11.648 0L9.62 1.956l6.23 6.005H0v2.793h15.85L9.62 16.76l2.028 1.956 9.705-9.358z" class="tribe-common-c-svgicon__svg-fill"/></svg>
<svg <?php tribe_classes( $svg_classes ); ?> viewBox="0 0 22 19" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path d="M11.648 0L9.62 1.956l6.23 6.005H0v2.793h15.85L9.62 16.76l2.028 1.956 9.705-9.358z" class="tribe-common-c-svgicon__svg-fill"/></svg>
3 changes: 2 additions & 1 deletion src/views/v2/components/icons/caret-down.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
* @version 4.12.14
*
*/

$svg_classes = [ 'tribe-common-c-svgicon', 'tribe-common-c-svgicon--caret-down' ];

if ( ! empty( $classes ) ) {
$svg_classes = array_merge( $svg_classes, $classes );
}
?>
<svg <?php tribe_classes( $svg_classes ); ?> viewBox="0 0 10 7" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.008.609L5 4.6 8.992.61l.958.958L5 6.517.05 1.566l.958-.958z" class="tribe-common-c-svgicon__svg-fill"/></svg>
<svg <?php tribe_classes( $svg_classes ); ?> viewBox="0 0 10 7" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.008.609L5 4.6 8.992.61l.958.958L5 6.517.05 1.566l.958-.958z" class="tribe-common-c-svgicon__svg-fill"/></svg>
3 changes: 2 additions & 1 deletion src/views/v2/components/icons/caret-left.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
* @version 4.12.10
*
*/

$svg_classes = [ 'tribe-common-c-svgicon', 'tribe-common-c-svgicon--caret-left' ];

if ( ! empty( $classes ) ) {
$svg_classes = array_merge( $svg_classes, $classes );
}
?>
<svg <?php tribe_classes( $svg_classes ); ?> xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 16"><path d="M9.7 14.4l-1.5 1.5L.3 8 8.2.1l1.5 1.5L3.3 8l6.4 6.4z"/></svg>
<svg <?php tribe_classes( $svg_classes ); ?> xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 16" aria-hidden="true"><path d="M9.7 14.4l-1.5 1.5L.3 8 8.2.1l1.5 1.5L3.3 8l6.4 6.4z"/></svg>
4 changes: 2 additions & 2 deletions src/views/v2/components/icons/caret-right.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
* @var array<string> $classes Additional classes to add to the svg icon.
*
* @version 4.12.10
*
*/

$svg_classes = [ 'tribe-common-c-svgicon', 'tribe-common-c-svgicon--caret-right' ];

if ( ! empty( $classes ) ) {
$svg_classes = array_merge( $svg_classes, $classes );
}
?>
<svg <?php tribe_classes( $svg_classes ); ?> xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 16"><path d="M.3 1.6L1.8.1 9.7 8l-7.9 7.9-1.5-1.5L6.7 8 .3 1.6z"/></svg>
<svg <?php tribe_classes( $svg_classes ); ?> xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 16" aria-hidden="true"><path d="M.3 1.6L1.8.1 9.7 8l-7.9 7.9-1.5-1.5L6.7 8 .3 1.6z"/></svg>
3 changes: 2 additions & 1 deletion src/views/v2/components/icons/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
* @version 4.12.14
*
*/

$svg_classes = [ 'tribe-common-c-svgicon', 'tribe-common-c-svgicon--search' ];

if ( ! empty( $classes ) ) {
$svg_classes = array_merge( $svg_classes, $classes );
}
?>
<svg <?php tribe_classes( $svg_classes ); ?> viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M11.164 10.133L16 14.97 14.969 16l-4.836-4.836a6.225 6.225 0 01-3.875 1.352 6.24 6.24 0 01-4.427-1.832A6.272 6.272 0 010 6.258 6.24 6.24 0 011.831 1.83 6.272 6.272 0 016.258 0c1.67 0 3.235.658 4.426 1.831a6.272 6.272 0 011.832 4.427c0 1.422-.48 2.773-1.352 3.875zM6.258 1.458c-1.28 0-2.49.498-3.396 1.404-1.866 1.867-1.866 4.925 0 6.791a4.774 4.774 0 003.396 1.405c1.28 0 2.489-.498 3.395-1.405 1.867-1.866 1.867-4.924 0-6.79a4.774 4.774 0 00-3.395-1.405z"/></svg>
<svg <?php tribe_classes( $svg_classes ); ?> viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M11.164 10.133L16 14.97 14.969 16l-4.836-4.836a6.225 6.225 0 01-3.875 1.352 6.24 6.24 0 01-4.427-1.832A6.272 6.272 0 010 6.258 6.24 6.24 0 011.831 1.83 6.272 6.272 0 016.258 0c1.67 0 3.235.658 4.426 1.831a6.272 6.272 0 011.832 4.427c0 1.422-.48 2.773-1.352 3.875zM6.258 1.458c-1.28 0-2.49.498-3.396 1.404-1.866 1.867-1.866 4.925 0 6.791a4.774 4.774 0 003.396 1.405c1.28 0 2.489-.498 3.395-1.405 1.867-1.866 1.867-4.924 0-6.79a4.774 4.774 0 00-3.395-1.405z"/></svg>

0 comments on commit 63c562d

Please sign in to comment.