Skip to content

Commit

Permalink
[fix] sidebar not closing on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
Green-Ranger11 authored and westerandr committed May 10, 2024
1 parent 7e3657d commit 43dba5b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/app.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en" class="dark">
<head>
<meta charset="utf-8" />
Expand Down
7 changes: 3 additions & 4 deletions src/lib/components/Sidebar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
</script>

<div
class:-translate-x-full={!toggleSidebar}
class="w-full lg:hidden focus:shadow-outline z-20 variant-filled-surface
space-y-6 mt-16 pt-5 px-2 absolute overflow-hidden
inset-y-0 left-0 transform transition delay-200 duration-700 ease-in-out"
class={`w-full lg:hidden focus:shadow-outline z-20 variant-filled-surface
space-y-6 ${toggleSidebar ? '' : '-translate-x-full'} mt-16 pt-5 px-2 absolute overflow-hidden
inset-y-0 left-0 transform transition delay-200 duration-700 ease-in-out`}
>
<!-- nav -->
<div class="btn-group-vertical w-full">
Expand Down
2 changes: 1 addition & 1 deletion src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
visible = event.currentTarget.scrollTop > 150;
}
let toggleSidebar;
let toggleSidebar = false;
</script>

<svelte:head>
Expand Down

0 comments on commit 43dba5b

Please sign in to comment.