Skip to content

Commit

Permalink
Additional accessibility fixes and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
teppokoivula committed Jun 29, 2019
1 parent 7fdd04c commit 9151113
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.13.5] - 2019-06-29

### Fixed
- Additional accessibility fixes and improvements.

## [0.13.4] - 2019-06-29

### Changed
Expand Down
4 changes: 2 additions & 2 deletions ready.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php namespace ProcessWire;

/**
* Replace [icon class="xxx] with <i class="xxx"></i>
* Replace [icon class="xxx] with <i class="xxx" aria-hidden="true"></i>
*
* @param HookEvent $event
*/
function replaceIconShortcodes(HookEvent $event) {
// if found, replace icon shortags within rendered content
if (strpos($event->return, '[icon class="') !== false) {
$event->return = preg_replace('/\[icon class="([\-_a-z0-9 ]+)"\]/Ui', '<i class="$1"></i>', $event->return);
$event->return = preg_replace('/\[icon class="([\-_a-z0-9 ]+)"\]/Ui', '<i class="$1" aria-hidden="true"></i>', $event->return);
}
}
if ($page->template !== 'admin') {
Expand Down
2 changes: 1 addition & 1 deletion templates/fields/highlights.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<?php foreach ($page->highlights as $highlight): ?>
<div class="highlights__item">
<?php if ($highlight->icon): ?>
<i class="highlights__icon fas fa-<?= $highlight->icon ?>"></i>
<i class="highlights__icon fas fa-<?= $highlight->icon ?>" aria-hidden="true"></i>
<?php endif; ?>
<h2 class="highlights__headline"><?= $highlight->title ?></h2>
<?= $highlight->summary ?>
Expand Down
2 changes: 1 addition & 1 deletion templates/layouts/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<?php if ($home->logo): ?>
<img src="<?= $home->logo->maxSize(480, 240)->url ?>" alt="<?= $home->logo->description ?>">
<?php else: ?>
<i class="fas fa-layer-group"></i> <?= $site_name ?>
<i class="fas fa-layer-group" aria-hidden="true"></i> <?= $site_name ?>
<?php endif; ?>
</a>

Expand Down

0 comments on commit 9151113

Please sign in to comment.