2024-02-22 16:05:21 +01:00
|
|
|
<script>
|
|
|
|
export let padding = true
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<div class="drawer-contents" class:padding>
|
2021-04-28 16:18:56 +02:00
|
|
|
<div class:no-sidebar={!$$slots.sidebar} class="container">
|
2021-04-28 14:42:44 +02:00
|
|
|
{#if $$slots.sidebar}
|
|
|
|
<div class="sidebar">
|
|
|
|
<slot name="sidebar" />
|
|
|
|
</div>
|
|
|
|
{/if}
|
2021-04-27 17:43:56 +02:00
|
|
|
<div class="main">
|
2021-04-28 14:52:58 +02:00
|
|
|
<slot />
|
2021-04-27 17:43:56 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.drawer-contents {
|
2024-02-22 16:05:21 +01:00
|
|
|
height: 400px;
|
2021-04-27 17:43:56 +02:00
|
|
|
overflow-y: auto;
|
|
|
|
}
|
|
|
|
.container {
|
|
|
|
height: 100%;
|
|
|
|
display: grid;
|
2021-07-14 15:21:11 +02:00
|
|
|
grid-template-columns: 320px 1fr;
|
2021-04-27 17:43:56 +02:00
|
|
|
}
|
2021-04-28 14:42:44 +02:00
|
|
|
.no-sidebar {
|
|
|
|
grid-template-columns: 1fr;
|
|
|
|
}
|
2021-04-27 17:43:56 +02:00
|
|
|
.sidebar {
|
|
|
|
border-right: var(--border-light);
|
|
|
|
overflow: auto;
|
2021-07-14 15:21:11 +02:00
|
|
|
scrollbar-width: none;
|
2021-04-27 17:43:56 +02:00
|
|
|
}
|
2024-02-22 16:05:21 +01:00
|
|
|
.padding .sidebar {
|
|
|
|
padding: var(--spacing-xl);
|
|
|
|
}
|
2021-04-27 17:43:56 +02:00
|
|
|
.sidebar::-webkit-scrollbar {
|
|
|
|
display: none;
|
|
|
|
}
|
2024-02-23 11:15:53 +01:00
|
|
|
.main {
|
|
|
|
height: 100%;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
2024-02-22 16:05:21 +01:00
|
|
|
.padding .main {
|
2021-07-14 15:21:11 +02:00
|
|
|
padding: var(--spacing-xl);
|
2021-04-27 17:43:56 +02:00
|
|
|
}
|
|
|
|
.main :global(textarea) {
|
|
|
|
min-height: 200px;
|
|
|
|
}
|
|
|
|
.main :global(p) {
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
</style>
|