speced / speced/respec

Accessibility improvement : "back to top" icon

Open
#5,337 1 comment 1 reaction 2 assignees View on GitHub

@marcoscaceres is already working on this.

Since Aug 11, 2026.

  • #5391 by @copilot-swe-agent — open
Feature request
Dominant language
JavaScript
Stars
806
Forks
434
Avg merge
1d 21h
Merged PRs (30d)
32

Description

Accessibility audits have reported that the "bask to top" button is too small and with improper "role" attribute:

<p role="navigation" id="back-to-top">
    <a href="#title"><abbr title="Back to Top">↑</abbr></a>
</p>

Excerpt from accessibility audit:

the “back to top” link is too small and hard to see. It is difficult to click with a mouse or tap with a finger on mobile phones and tablets.
The link's source code contains role="navigation", but this role should only be used for a group of navigation links that help users move around the website (like the main menu, footer, or breadcrumbs). Also, the link text is just an arrow inside an tag. Some screen readers ignore this tag, meaning they might only read "link, up arrow" or "link, empty".
How-to fix

  • Increase the size and visibility: Make the button larger (at least 44x44 pixels for a good touch target) and improve its colour contrast.
  • Clean up the code: Remove role="navigation" from the <p> tag.
  • Add an accessible name: Use an aria-label on the link so screen readers know exactly what it does, and hide the visual arrow from assistive technologies using aria-hidden="true".

updated code example:

<p id="back-to-top"> 
      <a href="#title" aria-label="Back to top"> <span aria-hidden="true">↑</span> </a> 
</p>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.