Skip to content

Commit

Permalink
fix(root): added aria-role to wrapper element in ic-footer
Browse files Browse the repository at this point in the history
added role="list" to wrapper of footer-links to prevent a11y failures. Also added example to code
snippets to show how to do it
  • Loading branch information
GCHQ-Developer-741 committed Dec 4, 2024
1 parent ce13302 commit 7e19b41
Show file tree
Hide file tree
Showing 3 changed files with 826 additions and 825 deletions.
2 changes: 1 addition & 1 deletion src/components/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ const Layout: React.FC<LayoutProps> = ({
{footerLink.text}
</ic-footer-link>
))}
<div slot="logo" className="logo-wrapper">
<div slot="logo" className="logo-wrapper" role="list">
<ic-footer-link href="https://sis.gov.uk">
<SISLogo aria-hidden="true" />
<span className="link-text">Go to S.I.S. website</span>
Expand Down
5 changes: 3 additions & 2 deletions src/content/structured/components/footer/code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export const snippetsLogoLinks = [
<ic-footer-link slot="link" href="#">Styles</ic-footer-link>
<ic-footer-link slot="link" href="#">Components</ic-footer-link>
<ic-footer-link slot="link" href="#">Patterns</ic-footer-link>
<div slot="logo">
<div slot="logo" role="list">
<ic-footer-link href="#">
<svg xmlns="http://www.w3.org/2000/svg"
height="48"
Expand Down Expand Up @@ -267,7 +267,7 @@ export const snippetsLogoLinks = [
<IcFooterLink slot="link" href="#">Styles</IcFooterLink>
<IcFooterLink slot="link" href="#">Components</IcFooterLink>
<IcFooterLink slot="link" href="#">Patterns</IcFooterLink>
<div slot="logo">
<div slot="logo" role="list">
<IcFooterLink href="#">
<SlottedSVG
xmlns="http://www.w3.org/2000/svg"
Expand Down Expand Up @@ -332,6 +332,7 @@ export const snippetsLogoLinks = [
display: "flex",
gap: "var(--ic-space-lg)",
}}
role="list"
>
<IcFooterLink href="#">
<svg
Expand Down
Loading

0 comments on commit 7e19b41

Please sign in to comment.