Skip to content
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

feat: Custom Collapsible component #3631

Merged
merged 7 commits into from
Jul 6, 2024
Merged
Prev Previous commit
Next Next commit
refactor: Update Collapsible component to include dynamic margin for …
…open state
  • Loading branch information
ricky-davis committed Jul 4, 2024
commit 78ba18a680f9cce4c895279282ecf60fc581f382
4 changes: 2 additions & 2 deletions src/lib/components/common/Collapsible.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 20,15 @@
<button on:click={() => (open = !open)}>
<slot name="head" />
</button>
<div bind:this={contentElement} class="collapsible-content" style="max-height: {maxHeight};">
<div bind:this={contentElement} class={`collapsible-content ${open ? 'mt-1' : '!mt-0'}`} style="max-height: {maxHeight};">
<slot name="content" />
</div>
</div>

<style>
.collapsible-content {
overflow: hidden;
transition: max-height 0.3s ease-out;
transition: all 0.3s ease-out;
max-height: 0;
}
</style>