Skip to content

Commit

Permalink
responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
dawoodkhan82 committed Jan 29, 2025
1 parent fb0806f commit 4bf6267
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions js/sidebar/shared/Sidebar.svelte
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
<script lang="ts">
import { createEventDispatcher } from "svelte";
import { createEventDispatcher, onMount } from "svelte";
const dispatch = createEventDispatcher<{
expand: void;
collapse: void;
}>();
export let open = true;
let sidebar_div: HTMLElement;
onMount(() => {
sidebar_div.parentElement?.classList.add('sidebar-parent');
});
</script>

<div class="sidebar" class:open>
<div class="sidebar" class:open bind:this={sidebar_div}>
<button
on:click={() => {
open = !open;
Expand All @@ -31,6 +36,17 @@
</div>

<style>
:global(.sidebar-parent) {
display: flex !important;
min-height: 100vh;
padding-left: 0;
transition: padding-left 0.3s ease-in-out;
}
:global(.sidebar-parent:has(.sidebar.open)) {
padding-left: var(--size-32);
}
.sidebar {
display: flex;
flex-direction: column;
Expand Down

0 comments on commit 4bf6267

Please sign in to comment.