Skip to content

Update header mobile bugs #53

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

Merged
merged 2 commits into from
Nov 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/lib/features/NavMenuMobile.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
export let menuItems: MenuItem[] = [];
export let toggleIdentifier: string = 'mobile-menu-toggle';

// isOpen for updating Aria state only
// isOpen is bound to the checkbox state
let isOpen: boolean = false;
</script>

Expand All @@ -17,7 +17,7 @@
classes="cursor-pointer text-navy peer-checked:text-white peer-checked:hover:text-teal hover:text-teal flex self-center lg:hidden"
/>
<div
class="z-1 fixed right-0 top-0 z-10 flex h-0 w-[100vw] flex-col justify-between gap-f24 overflow-y-scroll bg-navy px-[12%] transition-[height] duration-[1s] peer-checked:h-[100vh] lg:hidden"
class="z-1 fixed left-0 top-0 z-10 flex h-0 w-[100vw] flex-col justify-between gap-f24 overflow-y-scroll bg-navy px-[12%] transition-[height] duration-[1s] peer-checked:h-[100vh] lg:hidden"
aria-expanded={isOpen}
>
<nav id="mobile-navigation" aria-label="Main" class="mb-f20 mt-[85px] flex flex-col gap-f24 text-white">
Expand All @@ -35,8 +35,11 @@
<a
href={item.href}
target={item.isExternal ? '_blank' : '_self'}
class={`h4 underline-on-hover font-bold after:bg-current`}>{item.label}</a
class={`h4 underline-on-hover font-bold after:bg-current`}
on:click={() => (item.isExternal ? null : (isOpen = false))}
>
{item.label}
</a>
{/if}
{/each}
</nav>
Expand Down