Skip to content

Commit 1b2eef0

Browse files
ENH Hide PHP font icons from screen readers (#205)
1 parent 182dc1e commit 1b2eef0

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/Forms/GridFieldSiteTreeAddNewButton.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ public function getHTMLFragments($gridField)
110110

111111
$addAction = GridField_FormAction::create($gridField, 'add', $this->buttonName, 'add', 'add');
112112
$addAction
113-
->setAttribute('data-icon', 'add')
114-
->addExtraClass('no-ajax btn btn-primary font-icon-plus');
113+
->setIcon('add')
114+
->addExtraClass('no-ajax btn btn-primary');
115115

116116
$forTemplate = ArrayData::create();
117117
$forTemplate->Fields = ArrayList::create();

src/Forms/GridFieldSiteTreeState.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function getColumnContent($gridField, $record, $columnName)
4747

4848
$published = $record->isPublished();
4949
if (!$published) {
50-
return '<i class="font-icon-pencil btn--icon-md"></i>' . _t(
50+
return '<span class="font-icon-pencil btn--icon-md" aria-hidden="true"></span>' . _t(
5151
__CLASS__ . '.Draft',
5252
'Saved as Draft on {date}',
5353
'State for when a post is saved.',
@@ -56,7 +56,7 @@ public function getColumnContent($gridField, $record, $columnName)
5656
)
5757
);
5858
}
59-
return '<i class="font-icon-check-mark-circle btn--icon-md"></i>' . _t(
59+
return '<span class="font-icon-check-mark-circle btn--icon-md" aria-hidden="true"></span>' . _t(
6060
__CLASS__ . '.Published',
6161
'Published on {date}',
6262
'State for when a post is published.',

0 commit comments

Comments
 (0)