-
Notifications
You must be signed in to change notification settings - Fork 18
fix: add alt tags, aria-labels, and aria-hidden for accessibility #597
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,6 +78,9 @@ const Index = ({ account, isMyAccount = false, identity }: Props) => { | |
| height: "100%", | ||
| }} | ||
| src={identity.avatar} | ||
| alt={ | ||
| identity?.name ? `${identity.name} avatar` : `${account} avatar` | ||
| } | ||
| /> | ||
| ) : ( | ||
| <Box | ||
|
|
@@ -224,12 +227,13 @@ const Index = ({ account, isMyAccount = false, identity }: Props) => { | |
| href={identity.url} | ||
| target="__blank" | ||
| rel="noopener noreferrer" | ||
| aria-label={`Visit ${identity.url.replace(/(^\w+:|^)\/\//, "")}`} | ||
|
Comment on lines
227
to
+230
|
||
| > | ||
| <Flex | ||
| align="center" | ||
| css={{ marginTop: "$2", marginRight: "$3" }} | ||
| > | ||
| <Box as={GlobeIcon} css={{ marginRight: "$1" }} /> | ||
| <Box as={GlobeIcon} css={{ marginRight: "$1" }} aria-hidden="true" /> | ||
| {identity.url.replace(/(^\w+:|^)\/\//, "")} | ||
| </Flex> | ||
|
Comment on lines
+230
to
238
|
||
| </A> | ||
|
|
@@ -242,12 +246,13 @@ const Index = ({ account, isMyAccount = false, identity }: Props) => { | |
| href={`https://twitter.com/${identity.twitter}`} | ||
| target="__blank" | ||
| rel="noopener noreferrer" | ||
| aria-label={`View ${identity.twitter} on Twitter`} | ||
|
Comment on lines
246
to
+249
|
||
| > | ||
| <Flex | ||
| align="center" | ||
| css={{ marginTop: "$2", marginRight: "$3" }} | ||
| > | ||
| <Box as={TwitterLogoIcon} css={{ marginRight: "$1" }} /> | ||
| <Box as={TwitterLogoIcon} css={{ marginRight: "$1" }} aria-hidden="true" /> | ||
| <Box | ||
| css={{ | ||
| "@media (max-width: 400px)": { | ||
|
|
@@ -268,12 +273,13 @@ const Index = ({ account, isMyAccount = false, identity }: Props) => { | |
| href={`https://github.com/${identity.github}`} | ||
| target="__blank" | ||
| rel="noopener noreferrer" | ||
| aria-label={`View ${identity.github} on GitHub`} | ||
|
Comment on lines
273
to
+276
|
||
| > | ||
| <Flex | ||
| align="center" | ||
| css={{ marginTop: "$2", marginRight: "$3" }} | ||
| > | ||
| <Box as={GitHubLogoIcon} css={{ marginRight: "$1" }} /> | ||
| <Box as={GitHubLogoIcon} css={{ marginRight: "$1" }} aria-hidden="true" /> | ||
| <Box | ||
| css={{ | ||
| "@media (max-width: 400px)": { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
next/linkin Next.js 16 renders an<a>internally; nesting a literal<a>child can trigger the “Invalid with child” error and produce invalid nested anchors. Putaria-labelon the<Link>itself (or uselegacyBehaviorif you truly need a child anchor).