-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
A11y: Set alt=""
on course badges and some other illustrative images
#3993
Comments
Hi @Asartea I would like to work on this a11y image alt issue! I will focus on image alt only and scan through our pages and make changes. |
@Asartea For the course badges, you're talking about how, for example, in the following screenshot: The badge has an If so, then we don't want to make the alt text an empty string. Since the badge is inside a link, we need the image to have an alt text both to provide an accessible name for the link, and to display visible text should the image not load. What we should do is remove the "badge" text from the alt text, though. So "Intermediate HTML and CSS" instead of "Intermediate HTML and CSS badge". Whether we really need these badges to also be links is another question. I would also think that we could convey the progress displayed in a badge as well (which again is another matter). For the other spots you mentioned, yeah we should update the alt text for those to be an empty string. |
@thatblindgeye feel free to assign it to them; always happy to see someone else working on a11y stuff |
@luuu-xu you're assigned! |
@thatblindgeye Hi, I wanted to get an opinion from you.
I understand and agree on this change and have made these changes sitewide. But when I am checking the course badges on our index page, where there are 9 courses in a flexbox under "Learn everything you need to know". The screenreader will read these links to be "link, heading level 3, ruby, ruby" because now the badge |
@luuu-xu excellent catch! I'd agree that for those particular badges |
@thatblindgeye Thank you! I think I've got everything and I am creating the PR now. I am still new to improving a11y so I would love to learn and work with you on more of these issues too! |
@thatblindgeye @Asartea Hi, I am not sure who I should ask for a review for the PR I submitted. Let me know! Thank you! |
I'm not a maintainer, and so I can't give a review as GitHub means it, but I will note that you seem to have some linter errors you'll need to fix before it gets merged |
I have requested a review on the PR from a maintainer |
<!-- Thank you for taking the time to contribute to The Odin Project. In order to get this pull request (PR) merged in a reasonable amount of time, you must complete this entire template. --> ## Because <!-- Summarize the purpose or reasons for this PR, e.g. what problem it solves or what benefit it provides. --> Some images like course badges, illustrative images, and user avatars have `alt` not optimized for a11z. ## This PR <!-- A bullet point list of one or more items describing the specific changes. --> 1. For **Course Badge** images, their `alt="Ruby"` is changed to its course's name since these images are inside of links. 2. Except for the **flexbox of course badges** on landing page, their `alt=""` is set to empty since their siblings are headers with course names and their parents are links. Setting `alt` to course names would result in screen readers reading duplicate names. 3. For some **illustrative images**, their `alt=""` is set to empty since they are purely decorative and images are not conveying any meaningful messages because they have texts beside them. 4. **Users' avatars** under success stories now have `alt=""` because again they are accompanied by users' names as links and the images are just photographs of these users. ## Issue <!-- If this PR closes an open issue in this repo, replace the XXXXX below with the issue number, e.g. Closes #2013. If this PR closes an open issue in another TOP repo, replace the #XXXXX with the URL of the issue, e.g. Closes https://github.com/TheOdinProject/curriculum/issues/XXXXX If this PR does not close, but is related to another issue or PR, you can link it as above without the 'Closes' keyword, e.g. 'Related to #2013'. --> Closes #3993 ## Additional Information <!-- Any other information about this PR, such as a link to a Discord discussion. --> ## Pull Request Requirements <!-- Replace the whitespace between the square brackets with an 'x', e.g. [x]. After you create the PR, they will become checkboxes that you can click on. --> - [x] I have thoroughly read and understand [The Odin Project Contributing Guide](https://github.com/TheOdinProject/theodinproject/blob/main/CONTRIBUTING.md) - [x] The title of this PR follows the `keyword: brief description of change` format, using one of the following keywords: - `Feature` - adds new or amends existing user-facing behavior - `Chore` - changes that have no user-facing value, refactors, dependency bumps, etc - `Fix` - bug fixes - [x] The `Because` section summarizes the reason for this PR - [x] The `This PR` section has a bullet point list describing the changes in this PR - [x] I have verified all tests and linters pass after making these changes. - [x] If this PR addresses an open issue, it is linked in the `Issue` section - [ ] If applicable, this PR includes new or updated automated tests --------- Co-authored-by: Kevin <[email protected]>
<!-- Thank you for taking the time to contribute to The Odin Project. In order to get this pull request (PR) merged in a reasonable amount of time, you must complete this entire template. --> ## Because <!-- Summarize the purpose or reasons for this PR, e.g. what problem it solves or what benefit it provides. --> Some images like course badges, illustrative images, and user avatars have `alt` not optimized for a11z. ## This PR <!-- A bullet point list of one or more items describing the specific changes. --> 1. For **Course Badge** images, their `alt="Ruby"` is changed to its course's name since these images are inside of links. 2. Except for the **flexbox of course badges** on landing page, their `alt=""` is set to empty since their siblings are headers with course names and their parents are links. Setting `alt` to course names would result in screen readers reading duplicate names. 3. For some **illustrative images**, their `alt=""` is set to empty since they are purely decorative and images are not conveying any meaningful messages because they have texts beside them. 4. **Users' avatars** under success stories now have `alt=""` because again they are accompanied by users' names as links and the images are just photographs of these users. ## Issue <!-- If this PR closes an open issue in this repo, replace the XXXXX below with the issue number, e.g. Closes TheOdinProject#2013. If this PR closes an open issue in another TOP repo, replace the #XXXXX with the URL of the issue, e.g. Closes https://github.com/TheOdinProject/curriculum/issues/XXXXX If this PR does not close, but is related to another issue or PR, you can link it as above without the 'Closes' keyword, e.g. 'Related to TheOdinProject#2013'. --> Closes TheOdinProject#3993 ## Additional Information <!-- Any other information about this PR, such as a link to a Discord discussion. --> ## Pull Request Requirements <!-- Replace the whitespace between the square brackets with an 'x', e.g. [x]. After you create the PR, they will become checkboxes that you can click on. --> - [x] I have thoroughly read and understand [The Odin Project Contributing Guide](https://github.com/TheOdinProject/theodinproject/blob/main/CONTRIBUTING.md) - [x] The title of this PR follows the `keyword: brief description of change` format, using one of the following keywords: - `Feature` - adds new or amends existing user-facing behavior - `Chore` - changes that have no user-facing value, refactors, dependency bumps, etc - `Fix` - bug fixes - [x] The `Because` section summarizes the reason for this PR - [x] The `This PR` section has a bullet point list describing the changes in this PR - [x] I have verified all tests and linters pass after making these changes. - [x] If this PR addresses an open issue, it is linked in the `Issue` section - [ ] If applicable, this PR includes new or updated automated tests --------- Co-authored-by: Kevin <[email protected]>
Complete the following REQUIRED checkboxes:
brief description of request
format, e.g.Add dark mode to website
The following checkbox is OPTIONAL:
1. Description of the Feature Request:
Currently all of the course badges have an alt text of
course name badge
, but this does sounds weird when read by a screenreader and also serves no real purpose, as this info is always also conveyed by an accompanying header. These images instead should have their alt text set to none (alt=""
) to prevent screenreaders from reading them.There are also several other images for which this is an issue:
/about
/contributing
2. Acceptance Criteria:
Tasks
The text was updated successfully, but these errors were encountered: