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

feat(theme-default): sync anchor permalink function updates for better a11y #11

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

nruffing
Copy link
Contributor

@nruffing nruffing commented Dec 9, 2023

…(vuepress#1363)

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Provide a description in this PR that addresses what the PR is solving. If this PR is going to solve an existing issue, please reference the issue (e.g. close #123).

What is the purpose of this pull request?

  • Bug fix
  • New feature
  • Other

Description

The heading anchors have aria-hidden attributes but are still focusable via keyboard navigation. There was a bit of discussion around this already in the markdown-it-anchor repo and you can address this by just using the headerLink render function instead of the ariaHidden render function since it wraps the entire header in an anchor.

This PR is the theme-default style updates for the markup changes from PR #1452 in vuepress-next.

This fixes #1363

Screenshots

Before

Screenshot 2023-12-09 at 11 26 40 AM

Hover
Screenshot 2023-12-09 at 11 26 46 AM

With Markup Changes but Without Style Updates

Screenshot 2023-12-09 at 11 18 35 AM

Hover
Screenshot 2023-12-09 at 11 18 41 AM

After

Screenshot 2023-12-09 at 11 31 52 AM

Hover
Screenshot 2023-12-09 at 11 31 58 AM

@meteorlxy meteorlxy changed the title fix: use headerLink from markdown-it-anchor for better accessibility … feat(theme-default): sync anchor permalink function updates for better a11y Dec 12, 2023
@meteorlxy meteorlxy merged commit 93e6a04 into vuepress:main Dec 12, 2023
8 checks passed
@meteorlxy
Copy link
Member

Thanks for your contributions! ❤️

@nruffing nruffing deleted the accessible-anchors branch December 23, 2023 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants