Skip to content
This repository has been archived by the owner on Dec 2, 2022. It is now read-only.

Commit

Permalink
Fix: Add 'speak: none' to FontAwesome icons for accessibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
gjb2048 committed Mar 12, 2016
1 parent f52f590 commit 33d74c2
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ New in 3.0.1.1
- FIX: Style guide settings tooltips and popups.
- FIX: MDL-52936 - Fix link hover bug on iOS.
- FIX: Apply 'aria-hidden="true"' to FontAwesome icons as much as possible. Still a few 'content' CSS attributes to consider.
- FIX: Add 'speak: none' to FontAwesome icons for accessibility.
- NEW: Issue #632: View StyleGuide without logging on.

New in 3.0.1
Expand Down
4 changes: 2 additions & 2 deletions classes/output/core_renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1312,10 +1312,10 @@ public function render_pix_icon(pix_icon $icon) {
if (array_key_exists($icon->pix, $icons)) {
$pix = $icons[$icon->pix];
if (empty($icon->attributes['alt'])) {
return '<span class="fa fa-'.$pix.' icon" aria-hidden="true">'.parent::render_pix_icon($icon).'</span>';
return '<span class="fa fa-'.$pix.' icon" aria-hidden="true"></span>';
} else {
$alt = $icon->attributes['alt'];
return '<span class="fa fa-'.$pix.' icon" title="'.$alt.'" aria-hidden="true">'.parent::render_pix_icon($icon).'</span>';
return '<span class="fa fa-'.$pix.' icon" title="'.$alt.'" aria-hidden="true"></span>';
}
} else {
return parent::render_pix_icon($icon);
Expand Down
1 change: 1 addition & 0 deletions less/essential.less
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
// Start with core.
@import "essential/core";
// Import the essential styles.
@import "essential/accessibility";
@import "essential/admin";
@import "essential/alert";
@import "essential/autocomplete";
Expand Down
5 changes: 5 additions & 0 deletions less/essential/accessibility.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Do not vocalise icons.
// Ref: http://www.w3schools.com/cssref/css_ref_aural.asp.
.@{fa-css-prefix}, :before {
speak: none;
}
2 changes: 1 addition & 1 deletion less/moodle/pix/course.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

.coursebox > .info > .coursename a {
//background-image:url([[pix:moodle|i/course]]);
background-image: transparent;
background-image: none;
}
.dir-rtl .coursebox > .info > .categoryname a {
//background-position: center right;
Expand Down
2 changes: 1 addition & 1 deletion style/essential-rtl.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions style/essential-rtl_ie9.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion style/essential.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions style/essential_ie9.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion style/moodle-pix.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 33d74c2

Please sign in to comment.