-
Notifications
You must be signed in to change notification settings - Fork 19
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
Improve code block sections for screen readers #260
Comments
Hi @janosdebugs, i would like to have a go at this issue. Could you please help me out with the relevant part of the code that is responsible for rendering the .mdx files? |
Hey @SypherSP sorry I missed this, I've assigned you. Regarding the specific implementation, in order to make the code more accessible, we should do the following (in order, happy to have separate PRs for these):
To test this feature you can:
All 3 of these require some getting used to, please familiarize yourself with them so you can test this properly. Specifically, please look at the browse vs. focus mode when using NVDA, these can be a bit confusing at first. |
Could you explain what you mean by this. What do you think about implementing a new component like
which can be used in any mdx file like this
|
I personally would rather have the mdx be agnostic of what is rendering it where possible. |
Okay, ill look for another approach |
@Yantrio it may not be possible, we may have to create a subclass(?) of |
Using Swizzling we can add the figure wrapper easily, but to add a caption from markdown might be a little complicated. |
Let's try the figure wrapper first so we get a tabindex (if not present already). @SypherSP please test the changes with a screen reader before adding them, the code I posted is from another project and it may not work as well for this website. |
Yeah, im testing things as im adding them. Will link a pr as soon as i figure out wrapping. |
@janosdebugs I think this can be closed since the corresponding PR has been merged |
Thanks @codiini ! |
Currently, the code blocks are not marked up to make them easy to navigate for screen readers. This causes them to be read in line with the rest of the text.
There are several solutions to make them stand out. The easiest is to wrap them in a
<figure></figure>
. More advanced options could be adding arole
attribute to the block. A<figcaption></figcaption>
can also be used to enhance the experience alongside the appropriate CSS rules:The text was updated successfully, but these errors were encountered: