Merge pull request #287 from reuters-graphics/jon-header-footer-a11y
Header footer a11y
This commit is contained in:
commit
4d7e108f62
5 changed files with 22 additions and 5 deletions
5
.changeset/rude-beers-drive.md
Normal file
5
.changeset/rude-beers-drive.md
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@reuters-graphics/graphics-components': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
a11y fixes for SiteHeader and SiteFooter
|
||||||
|
|
@ -25,6 +25,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
let { links = {} }: Props = $props();
|
let { links = {} }: Props = $props();
|
||||||
|
|
||||||
|
const normaliseSocialName = (name: string) => {
|
||||||
|
if (name === 'twitter') return 'X';
|
||||||
|
return name;
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if links.social_links}
|
{#if links.social_links}
|
||||||
|
|
@ -42,7 +47,10 @@
|
||||||
{@const SvelteComponent =
|
{@const SvelteComponent =
|
||||||
symbols[link.type as keyof typeof symbols]}
|
symbols[link.type as keyof typeof symbols]}
|
||||||
<li class="social-links symbol">
|
<li class="social-links symbol">
|
||||||
<a href={normalizeUrl(link.url)}>
|
<a
|
||||||
|
href={normalizeUrl(link.url)}
|
||||||
|
aria-label="Visit Reuters on {normaliseSocialName(link.type)}"
|
||||||
|
>
|
||||||
<div class="button">
|
<div class="button">
|
||||||
<div class="social">
|
<div class="social">
|
||||||
<SvelteComponent />
|
<SvelteComponent />
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,11 @@
|
||||||
textColour="var(--nav-primary)"
|
textColour="var(--nav-primary)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<button class="button close-button" onclick={releaseMobileMenu}>
|
<button
|
||||||
|
class="button close-button"
|
||||||
|
aria-label="Close menu"
|
||||||
|
onclick={releaseMobileMenu}
|
||||||
|
>
|
||||||
<div class="button-container">
|
<div class="button-container">
|
||||||
<CloseIcon />
|
<CloseIcon />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="dropdown">
|
<div class="dropdown" data-chromatic="ignore">
|
||||||
<div class="dropdown-container">
|
<div class="dropdown-container">
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<div class="submenu">
|
<div class="submenu">
|
||||||
|
|
@ -78,7 +78,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="stories-container">
|
<div class="stories-container">
|
||||||
<div class="inner" data-chromatic="ignore">
|
<div class="inner">
|
||||||
{#if stories.length > 0}
|
{#if stories.length > 0}
|
||||||
<span class="latest">{headingText}</span>
|
<span class="latest">{headingText}</span>
|
||||||
<ul class="story-list">
|
<ul class="story-list">
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@
|
||||||
<a href={normalizeUrl(section.url)}>
|
<a href={normalizeUrl(section.url)}>
|
||||||
{section.name}
|
{section.name}
|
||||||
</a>
|
</a>
|
||||||
<button class="button">
|
<button class="button" aria-label="{section.name} menu">
|
||||||
<DownArrow rotate={section.id === $activeSection} />
|
<DownArrow rotate={section.id === $activeSection} />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue