Skip to content

Conversation

cuteshaun
Copy link
Contributor

@cuteshaun cuteshaun commented Jun 3, 2025

This PR resolves two WCAG 2.1 AA accessibility issues observed when the page is zoomed to 400%:

Issues

  • Focus order: The previously received keyboard focus before the main content, breaking logical tab order for screen readers and keyboard users.
  • Insufficient contrast: Footer text color failed to meet the minimum contrast ratio of 4.5:1, making it difficult to read for users with visual impairments.

Changes

  • Footer moved from the sidebar to the main layout template (_layouts/default.html), ensuring focus order flows logically:
    Header → Main Content → Footer
  • Footer text color updated to improve contrast and readability at high zoom levels.

New footer position:
Screenshot 2025-06-03 at 00 20 29

Closes: #538

Related upstream: just-the-docs/just-the-docs#1667

🔎 Note: The upstream issue has been opened in JustTheDocs. However, since the upstream review may take time (last comments in issues in February 2025), this PR applies a local fix in the meantime.

🧪 Testing
Confirmed fix via keyboard navigation at 400% zoom

Verified footer contrast with WCAG contrast checker tools

@cuteshaun cuteshaun force-pushed the cuteshaun/fix-footer-a11y branch from 820131d to 34eaebf Compare June 3, 2025 07:15
Copy link
Member

@samcunliffe samcunliffe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for this!

.site-footer {
position: static;
width: 100%;
color: #6a686d;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes colour contrast for light mode (🎉) but makes it worse in dark mode.

(new: #6a686d contrast ratio 2:27:1)
Screenshot 2025-06-03 at 10 25 30

(old: #959396 contrast ratio 4:9:1)
Screenshot 2025-06-03 at 10 35 21

Pretty sure we need to be theme-agnostic here and I think using $body-text-color from the upstream scss code works:

Suggested change
color: #6a686d;
color: $body-text-color;

I'm not sure about the styling though... that's probably a matter of taste. Do we prefer the footer to be a little bit less contrasty than the main body text?

Another option is to investigate intercepting the theme colours which may anyway be needed for #535.

Copy link
Contributor Author

@cuteshaun cuteshaun Jun 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for noticing this! My bad, forgot to check it in dark mode. I think the body text color fits pretty well, though.

@samcunliffe samcunliffe added enhancement New feature or request website Related to https://github-pages.arc.ucl.ac.uk/python-tooling accessibility Something relating to the ease of accessibility (alt-text, colour choices, language, etc) labels Jun 3, 2025
@samcunliffe samcunliffe requested a review from a team June 3, 2025 09:54
@samcunliffe
Copy link
Member

Link checker: 🟨 yellow card.


<div class="side-bar">
<div class="site-header" role="banner">
<a href="{{ '/' | relative_url }}" class="site-title lh-tight"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh! I'm sorry for doubting you, dear link-checker. I take back the yellow card.

@samcunliffe samcunliffe enabled auto-merge (squash) June 4, 2025 08:13
@samcunliffe samcunliffe merged commit 9eb2760 into UCL-ARC:main Jun 4, 2025
15 checks passed
@samcunliffe
Copy link
Member

Thanks again!

@all-contributors please add @cuteshaun for a11y and code!

Copy link
Contributor

@samcunliffe

I've put up a pull request to add @cuteshaun! 🎉

samcunliffe pushed a commit that referenced this pull request Jun 4, 2025
Adds @cuteshaun as a contributor for a11y, code.

This was requested by samcunliffe [in this
comment](#542 (comment))

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility Something relating to the ease of accessibility (alt-text, colour choices, language, etc) enhancement New feature or request website Related to https://github-pages.arc.ucl.ac.uk/python-tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve the position of the footer to make it easier for anyone viewing the site zoomed in to navigate by keyboard
2 participants