Skip to content

Issue-43: Add Skip Link#44

Closed
juliobranha wants to merge 5 commits intodevelopfrom
feature/issue-43/add-skip-to-content-link
Closed

Issue-43: Add Skip Link#44
juliobranha wants to merge 5 commits intodevelopfrom
feature/issue-43/add-skip-to-content-link

Conversation

@juliobranha
Copy link
Copy Markdown

@juliobranha juliobranha commented Sep 2, 2025

Summary

Fixes #43

This pull request introduces a "Skip to Content" accessibility feature to enhance keyboard and screen reader navigation:

  • Adds an accessible "Skip to Content" link at the very top of the page, allowing users to quickly jump to the main content area.
  • Implements new SCSS partials for accessibility (_a11y.scss) and layout (_layout.scss) in the assets/scss/ directory.
    • _a11y.scss includes a screen-reader-only mixin to visually hide content while keeping it accessible to assistive technologies, and a skip-link mixin to style skip navigation links for visibility when focused.
    • _layout.scss introduces an auto-margins mixin for horizontally centering elements.
  • Adds utility classes:
    • .screen-reader-text (for visually hidden, screen reader-accessible content)
    • .skip-link (for styling the skip link)
  • The skip link is hidden visually but becomes visible when focused, ensuring accessibility for keyboard users.

Testing Instructions

  • Navigate to the site.
  • Use the keyboard (Tab key) to focus on the "Skip to Content" link.
  • Verify that the link is visible when focused and allows skipping to the main content.
  • Ensure the link is accessible to screen readers.

Checklist

  • I have tested these changes locally.
  • I have updated documentation as needed.
  • I have added necessary unit/integration tests.
  • The code style follows the project's guidelines.

@juliobranha juliobranha added accessibility Improving the accessibility of an interface enhancement New feature or request css Requires understanding CSS/SCSS labels Sep 2, 2025
@juliobranha juliobranha marked this pull request as ready for review September 2, 2025 19:05
Copy link
Copy Markdown
Contributor

@kaitlinbolling kaitlinbolling left a comment

Choose a reason for hiding this comment

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

@juliobranha it looks like this is no longer needed, as WP automatically inserts a skip link on block themes that include a <main> tag. I think we should prefer core's implementation rather than introducing our own. I know I originally filed this issue -- I'm sorry for not noticing this sooner!

See: https://developer.wordpress.org/reference/functions/wp_enqueue_block_template_skip_link/

@juliobranha juliobranha closed this Sep 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility Improving the accessibility of an interface css Requires understanding CSS/SCSS enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Skip Link

2 participants