1
0
Fork 0
mirror of synced 2024-07-08 07:46:10 +12:00

display placeholders

This commit is contained in:
Keviin Åberg Kultalahti 2021-06-04 14:34:52 +02:00
parent f51c9d693a
commit f2139849ee

View file

@ -1,12 +1,17 @@
<script> <script>
import { log } from "console"
import { getContext } from "svelte" import { getContext } from "svelte"
const { styleable, transition } = getContext("sdk") const { styleable, transition } = getContext("sdk")
const component = getContext("component") const component = getContext("component")
export let type = "mainSidebar" export let type = "mainSidebar"
export let gap = "16px" export let gap = "16px"
let layoutMap = {
mainSidebar: 2,
sidebarMain: 2,
twoColumns: 2,
threeColumns: 3,
}
</script> </script>
<div <div
@ -15,6 +20,11 @@
class={type} class={type}
> >
<slot /> <slot />
{#if layoutMap[type] - $component.children > 0}
{#each new Array(layoutMap[type] - $component.children) as _}
<p><i class="ri-image-line" />Add some components to display.</p>
{/each}
{/if}
</div> </div>
<style> <style>
@ -34,4 +44,19 @@
.threeColumns { .threeColumns {
grid-template-columns: 1fr 1fr 1fr; grid-template-columns: 1fr 1fr 1fr;
} }
p {
background-color: var(--grey-3);
color: var(--grey-6);
font-size: var(--font-size-s);
padding: var(--spacing-l);
border-radius: var(--border-radius-s);
display: grid;
place-items: center;
}
p i {
margin-bottom: var(--spacing-m);
font-size: 1.5rem;
color: var(--grey-5);
}
</style> </style>