Make Front of House Icons and Tables Accessible #4215#4492
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
4654fd2 to
ad0f7a1
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
|
I categorised icons according to the below by inserting a comment above each icon - which I then removed before finalising the PR, so those comments can be found in the commit history to track the 'why' of each change. Icon CategoriesWe use both decorative and semantic icons in the Front of House. In every case, icons are inserted using the syntax: Icons should not be included in any other way unless no
Decorativethese icons are purely decorative, and should include <i aria-hidden="true" class="fa fa-search"></i>Semanticthese icons should be <span class="sr-only">{% trans 'Externally hosted article:' %} </span>
{{ article.title|safe }}
<i aria-hidden="true" class="fa fa-external-link small-icon-text"></i>or <i aria-hidden="true" class="fa fa-play" ></i>
<span class="sr-only">{% trans 'Play' %}</span>Special CasesDateThese icons are used to indicate a date, and should be marked as decorative with the date itself marked up with the <i aria-hidden="true" class="fa fa-calendar"></i>
<time datetime="{{ article.date_published|date:"Y-m-d" }}">
<span role="time">{{ article.date_published|date:"Y-m-d" }}</span>
</time>Email (within a loop)These icons are semantic, however as many of our email icons are as part of 'email author' links where a loop is used because there could be more than one author. In order to meet WCAG 2.4.4 these <a itemprop="email" href="mailto:{{ author.email }}" >
<i aria-hidden="true" class="fa fa-envelope email-link" ></i>
<span class="sr-only">{% trans 'Email' %} {{ author.full_name }}.</span>
</a>ORCID logo as a link to an author's ORCID profileHandle as Semantic Icons. These are not strictly icons, as it is included as a local <a href="https://orcid.org/{{ author.orcid }}" class="">
<img src="{% static 'common/img/icons/orcid.png' %}" alt="">
<span class="sr-only">{{author.full_name}} {% trans 'ORCID profile.' %}</span>
</a>XOur icon set doesn't include the X logo. But the unicode 𝕏 ( <span aria-hidden="true"> 𝕏</span>
<span class="sr-only">{% trans 'Share on X' %}</span>× for closeWe have used the unicode <button class="close-button" data-close aria-label="Close modal" type="button">
<span aria-hidden="true">×</span>
</button> |
a185ae6 to
daa4ae1
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
729d8d3 to
f7772d2
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
092624c to
f3e8e13
Compare
TestingResults
Notes
|
7c1715d to
d2ada22
Compare
|
I've re-assigned this issue to @StephDriver as there is an outstanding conflict. |
d2ada22 to
1e2862b
Compare
resolved. |
1e2862b to
fccfc36
Compare
|
conflicts resolved. I have also reviewed the new share templates that replace several icons used here, and they match the new syntax. |
joemull
left a comment
There was a problem hiding this comment.
Amazing work!
I caught one typo with missing end </span>.
I also wanted to request that we go ahead and use accessible form label elements for the search inputs that have until now been "labelled" by means of search icons. Please see comments inline about that. Is that acceptable in this PR or do you prefer to handle it separately along with accessible names for other form inputs?
| <span class="input-group-label"><i class="fa fa-search"></i></span> | ||
| <span class="input-group-label"><i aria-hidden="true" class="fa fa-search"></i></span> | ||
| <input class="input-group-field" type="search" name="article_search" placeholder="{% trans 'Search' %}"> | ||
| <input type="hidden" name="sort" value="title"> |
There was a problem hiding this comment.
This search input is still missing an accessible name. The placeholder is not enough because it goes away once the user types something. Can we add an sr-only label with a value of "Search" and tie it to the input?
<span class="input-group-label"><i aria-hidden="true" class="fa fa-search"></i></span>
<label class="sr-only" for="article_search">{% trans "Search" %}</label>
<input class="input-group-field" type="search" name="article_search" id="article_search" placeholder="{% trans 'Search' %}">There was a problem hiding this comment.
this is no more inaccessible than before, this change was just about icons.
| <i aria-hidden="true" class="fa fa-search"></i> | ||
| <span class="sr-only">{% trans 'Search' %}</span> | ||
| </span> | ||
| <input name="article_search" class="input-group-field" type="text"> |
There was a problem hiding this comment.
Similar to with the OLH theme template for search, this needs a more robust label explicitly tied to the input. In this case I think the <span class="sr-only"> should be changed to a label and tied to the input with a "for" attribute.
There was a problem hiding this comment.
great, but not in this PR.
| <i aria-hidden=true class="fa fa-search"></i> | ||
| </span> | ||
| <input class="input-group-field" type="search" name="search_term" | ||
| placeholder="Search {{ request.repository.object_name_plural }}..."> |
There was a problem hiding this comment.
This needs an accessible label like the other two search bars above.
In this case a label with sr-only and a for linked to the search input should do the trick.
There was a problem hiding this comment.
yes, but not in this PR.
| </span> | ||
| <input class="input-group-field" type="search" name="search_term" | ||
| placeholder="{% trans "Search preprints" %}" | ||
| {% if search_term %}value="{{ search_term }}"{% endif %}> |
There was a problem hiding this comment.
As above, use label instead of span for the sr-only line, and connect it to the search input with for
|
@joemull I think adding in Search labels is feature creep over this PR which was very specifically for icons and tables (the two were originally separate, but the table one hadn't gone through and they handle the same lines, so they were bundled for practicality, the search changes haven't even been started yet, so not the same). the accessible search is needed, but that's out of scope here - and needs to be done across all templates just like these changes were done across all to get them standardised. The search is no less accessible than it was before. |
closes #4215
closes #4055