Skip to content

fix(a11y): Remove pre tags from a11y-no-noninteractive-tabindex flag#13794

Merged
ascorbic merged 3 commits intowithastro:mainfrom
alexcarpenter:main
May 21, 2025
Merged

fix(a11y): Remove pre tags from a11y-no-noninteractive-tabindex flag#13794
ascorbic merged 3 commits intowithastro:mainfrom
alexcarpenter:main

Conversation

@alexcarpenter
Copy link
Contributor

Changes

  • What does this change?
  • Be short and concise. Bullet points can help!
  • Before/after screenshots can help as well.
  • Don't forget a changeset! pnpm exec changeset

Fixes #13793

Adds check for pre tags within a11y-no-noninteractive-tabindex a11y audit check.

tabindex on pre tags is actually good for accessibility as it gives keyboard users the ability to scroll a code block. Shiki adds the tabindex attribute to pre tags by default.

Currently it is only checking for the element being scrollable, which might not always be the case in codeblocks. So we explicitly check for pre tags.

Testing

Docs

@changeset-bot
Copy link

changeset-bot bot commented May 13, 2025

🦋 Changeset detected

Latest commit: 5d27863

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label May 13, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented May 13, 2025

CodSpeed Performance Report

Merging #13794 will not alter performance

Comparing alexcarpenter:main (5d27863) with main (3aa5337)

Summary

✅ 6 untouched benchmarks

Copy link
Contributor

@ascorbic ascorbic left a comment

Choose a reason for hiding this comment

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

Thanks!

@ascorbic ascorbic merged commit 85b19d8 into withastro:main May 21, 2025
5 checks passed
@astrobot-houston astrobot-houston mentioned this pull request May 21, 2025
openscript pushed a commit to openscript/astro that referenced this pull request Sep 12, 2025
…ithastro#13794)

* fix(a11y): Remove pre tags from a11y-no-noninteractive-tabindex flag

* add changeset

* Update packages/astro/src/runtime/client/dev-toolbar/apps/audit/rules/a11y.ts

---------

Co-authored-by: Matt Kane <m@mk.gg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shiki powered codeblocks flagged by a11y audit

2 participants