The great button centerification

This commit is contained in:
2023-11-16 12:17:36 +01:00
parent c2372dbcb3
commit 548c9e1479
12 changed files with 145 additions and 72 deletions

View File

@@ -7,6 +7,7 @@ let global_index = 10000;
<script>
import { createEventDispatcher } from 'svelte';
import { fade } from 'svelte/transition';
import Button from '../layout/Button.svelte';
// Form can be used to turn the modal into a save dialog. Enter the ID of a form
// inside the modal and the modal will provide a submit button for that form
@@ -72,23 +73,12 @@ const keydown = e => {
<div class="header">
<slot name="title">
{#if form !== ""}
<button class="button" on:click={hide}>
<i class="icon">close</i> Cancel
</button>
<Button click={hide} icon="close" label="Cancel"/>
<div class="title">{title}</div>
<button
class="button button_highlight"
type="submit"
form="{form}"
on:click={hide}
>
<i class="icon">save</i> Save
</button>
<Button highlight type="submit" form={form} click={hide} icon="save" label="Save"/>
{:else}
<div class="title">{title}</div>
<button class="button round" on:click={hide}>
<i class="icon">close</i>
</button>
<Button round click={hide} icon="close" />
{/if}
</slot>
</div>
@@ -156,10 +146,6 @@ these padding divs to move it 25% up */
text-overflow: ellipsis;
overflow: hidden;
}
.button {
flex-grow: 0;
flex-shrink: 0;
}
.body {
flex-grow: 1;
flex-shrink: 1;