sm Modal size

This commit is contained in:
venashial
2022-06-18 17:31:29 -07:00
parent 87a8706299
commit a1932fa3dc
2 changed files with 21 additions and 8 deletions

View File

@@ -7,7 +7,7 @@
export let open = false
/** Set the width of the modal */
export let size: 'md' | 'lg' = 'md'
export let size: 'sm' | 'md' | 'lg' = 'md'
export let title = ''
@@ -39,12 +39,14 @@
<div
class={classCombine(['modal', `modal--size-${size}`, 'card'])}
transition:fly={{ y: 400, duration: 250 }}>
<div class="modal__top">
<h2 class="title-secondary">{title}</h2>
<Button title="Close" color="transparent" on:click={close}>
<IconX width={20} />
</Button>
</div>
{#if title}
<div class="modal__top">
<h2 class="title-secondary">{title}</h2>
<Button title="Close" color="transparent" on:click={close}>
<IconX width={20} />
</Button>
</div>
{/if}
<slot />
@@ -83,6 +85,9 @@
overflow-y: auto;
&--size {
&-sm {
max-width: 450px;
}
&-md {
max-width: 600px;
}