Skip to content

Commit

Permalink
Merge pull request #528 from City-of-Helsinki/LOM-300_accessibility_f…
Browse files Browse the repository at this point in the history
…ixes

LOM-300 Accessibility fixes
  • Loading branch information
teroelonen authored Feb 1, 2023
2 parents 7164a22 + 731ac56 commit 0dadf35
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/css/ckeditor-icons.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/hdbt-icons.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/styles.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/icons.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["helsinki-ru","helsinki-sv","helsinki","email","abstract-1","abstract-2","abstract-3","abstract-4","abstract-5","abstract-6","hero-arrow-desktop","hero-arrow-mobile","info","link-external","mailto","tel","discord","facebook","google","instagram","linkedin","rss","snapchat","tiktok","twitch","twitter","vimeo","whatsapp","yle","youtube","alert-circle-fill","alert-circle","angle-down","angle-left","angle-right","angle-up","arrow-left","arrow-right","arrow-up","calendar-clock","calendar","camera","check-circle-fill","check-circle","check","clock","cogwheel","cross-circle","cross","customer-bot-neutral","display","document","download-cloud","download","envelope","error-fill","error","eye-crossed","eye","face-neutral","face-sad","face-smile","globe","glyph-at","glyph-euro","group","heart-fill","heart","home-smoke","home","info-circle-fill","info-circle","layers","link","locate","location","map","menu-dots","menu-hamburger","minus-circle-fill","minus-circle","minus","mobile","paperclip","person-female","person-male","person-wheelchair","phone","photo","plus-circle-fill","plus-circle","plus","podcast","printer","question-circle-fill","question-circle","search","share","signin","signout","sort-alphabetical-ascending","sort-alphabetical-descending","sort-ascending","sort-descending","sort","speechbubble-text","speechbubble","star-fill","star","ticket","trash","upload-cloud","upload","user","wifi-crossed","wifi","zoom-in","zoom-out","zoom-text"]
["helsinki-ru","helsinki-sv","helsinki","email","abstract-1","abstract-2","abstract-3","abstract-4","abstract-5","abstract-6","hero-arrow-desktop","hero-arrow-mobile","info","link-external","mailto","tel","discord","facebook","google","instagram","linkedin","rss","snapchat","tiktok","twitch","twitter","vimeo","whatsapp","yle","youtube","alert-circle-fill","alert-circle","angle-down","angle-left","angle-right","angle-up","arrow-left","arrow-right","arrow-up","calendar-clock","calendar","camera","check-circle-fill","check-circle","check","clock","cogwheel","cross-circle","cross","customer-bot-neutral","display","document","download-cloud","download","envelope","error-fill","error","eye-crossed","eye","face-neutral","face-sad","face-smile","globe","glyph-at","glyph-euro","group","heart-fill","heart","home-smoke","home","info-circle-fill","info-circle","layers","link","locate","location","map","menu-dots","menu-hamburger","minus-circle-fill","minus-circle","minus","mobile","paperclip","person-female","person-male","person-wheelchair","phone","photo","plus-circle-fill","plus-circle","plus","podcast","printer","question-circle-fill","question-circle","refresh","search","share","signin","signout","sort-alphabetical-ascending","sort-alphabetical-descending","sort-ascending","sort-descending","sort","speechbubble-text","speechbubble","star-fill","star","ticket","trash","upload-cloud","upload","user","wifi-crossed","wifi","zoom-in","zoom-out","zoom-text"]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/icons/editor-selectable-icons.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"printer",
"question-circle-fill",
"question-circle",
"refresh",
"search",
"share",
"signin",
Expand Down
File renamed without changes
11 changes: 11 additions & 0 deletions src/scss/07_utilities/_states.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
.is-hidden {
display: none;
}

// Override Drupals visually-hidden class with a bit more comprehensive class.
.visually-hidden:not(:focus):not(:active) {
clip: rect(0 0 0 0);
clip-path: inset(50%);
height: 1px;
overflow: hidden;
position: absolute;
white-space: nowrap;
width: 1px;
}
8 changes: 7 additions & 1 deletion templates/misc/icon.twig
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
<span class="hel-icon hel-icon--{{ icon }} {{ class }}" {% if label %} aria-label="{{ label }}" {% else %} aria-hidden="true" {% endif %}></span>
{% set icon_labelled_by = "hdbt-icon--" ~ random() %}

<span class="hel-icon hel-icon--{{ icon }} {{ class }}" role="img" {% if label %} aria-labelledby="{{ icon_labelled_by }}" {% else %} aria-hidden="true" {% endif %}>
{% if label %}
<span class="is-hidden" id="{{ icon_labelled_by }}">{{ label }}</span>
{% endif %}
</span>

0 comments on commit 0dadf35

Please sign in to comment.