Skip to content

Commit

Permalink
fix(a11y): add sr-only text in copy button
Browse files Browse the repository at this point in the history
  • Loading branch information
satnaing committed Sep 15, 2024
1 parent 6112077 commit ac1e0c7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/snippet-accordion-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ export default function SnippetAccordionItem({
className="absolute top-3 right-3 size-8"
onClick={() => setCopied(snippet)}
>
<span className="sr-only">
{copied ? "Code copied" : "Copy code"}
</span>
<IconCheck
size={16}
className={cn(
Expand Down

0 comments on commit ac1e0c7

Please sign in to comment.