Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessibility: Fix aria labels on section buttons #4373

Merged
merged 3 commits into from
Feb 14, 2025

Conversation

Menelion
Copy link
Contributor

@Menelion Menelion commented Feb 6, 2025

Why

In current platform.sh docs, there are quite a number of accessibility errors. Most of them are just annoying, but there was one thing that prevented really from using the docs with a screen reader correctly.
Each section has a button to expand it, and this button has an aria-label of "Toggle section". So imagine if each button had the same text: "Toggle section". that's how I see it on the currently released pages.

What's changed

If a button contains an SVG image (correctly hidden with aria-hidden="true" btw), then the aria-label is changed to have the title of the section in question. If however the section title was the text of the button itself (simplified code: <button>{{ .Title }}</button>), then the aria-label was removed as it is not needed anymore: the text between the button tags is read by all screen readers.

Where are changes

Updates are for:

  • platform (sites/platform templates)
  • upsun (sites/upsun templates)

@flovntp flovntp added the build-fork To build PRs from forks label Feb 6, 2025
Copy link
Contributor

@flovntp flovntp left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution

@flovntp flovntp merged commit 78cef9a into platformsh:main Feb 14, 2025
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-fork To build PRs from forks markdown/prose
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants