-
-
Notifications
You must be signed in to change notification settings - Fork 386
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
Scrollable <pre> elements should be focusable for WCAG 2.1 compliance #428
Comments
This results in tabindex applied to all code blocks which is in fact not WCAG compliant. It should only add tabindex when the codeblock is scrollable, but this of course would be difficult to know based on screen size etc. Maybe it's better to leave it up to the user to add tabindex themself Edit: upon further research having tabindex on non interactive element does not create an explicit WCAG violation AFAIK |
maybe we can add overflow to all |
The spec defines scrollable as having a scroll distance (e.g. the difference between the I would argue that it's best to default to having the |
Chrome has announced that they are going to implement keyboard-focusable scrollers at the browser level. In the context of this issue, that would mean the However, I have not heard anything about Safari adding this, so even if this lands in Chrome stable, having the occasionally unnecessary |
As mentioned in #220, scrollable
<pre>
elements should havetabindex="0"
to allow them to be focusable. Right now, these elements will fail WCAG audits if/when they become scrollable. https://www.w3.org/WAI/standards-guidelines/act/rules/0ssw9k/proposed/It seems ideal to me to make this the default rather than try to update consumers like
remark-shiki
, etc. to pass in a custompre
.I wouldn't expect this to be a breaking change since anyone who is already providing a
tabindex
will already be passing in an entirely custompre
template literal that will override this default.The text was updated successfully, but these errors were encountered: