fix(icons): add aria-hidden attribute to all icon components for accessibility(#485)#486
Open
simon5057 wants to merge 1 commit intovercel:mainfrom
Open
fix(icons): add aria-hidden attribute to all icon components for accessibility(#485)#486simon5057 wants to merge 1 commit intovercel:mainfrom
simon5057 wants to merge 1 commit intovercel:mainfrom
Conversation
18 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(icons): add
aria-hiddento decorative SVG icons for accessibilityProblem
Toolbar buttons in the Mermaid integration (and other components) contain inline SVG icons that are exposed to the accessibility tree, triggering the warning: "Content with images must be labeled" in accessibility audits (Firefox Accessibility Inspector, axe DevTools). While the parent buttons have
titleattributes providing accessible names, the SVGs themselves lacked properaria-hiddenattributes to mark them as decorative.Solution
Added
aria-hidden="true"to all 10 SVG icon components inpackages/streamdown/lib/icons.tsx:CheckIconCopyIconDownloadIconLoader2IconMaximize2IconRotateCcwIconXIconExternalLinkIconZoomInIconZoomOutIconThis hides the decorative SVGs from the accessibility tree. Screen readers will rely on the parent button
titleattributes instead, which already provide meaningful labels (e.g., "Zoom in", "Copy Code", "Download").Testing