diff --git a/ts/components/ButtonGroup.svelte b/ts/components/ButtonGroup.svelte index 2f8ca1053..6a5be8357 100644 --- a/ts/components/ButtonGroup.svelte +++ b/ts/components/ButtonGroup.svelte @@ -19,9 +19,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html export { className as class }; export let size: number | undefined = undefined; - export let wrap: boolean | undefined = undefined; - export let reverse = false; + export let wrap: boolean | undefined = undefined; $: buttonSize = size ? `--buttons-size: ${size}rem; ` : ""; let buttonWrap: string; @@ -47,9 +46,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html if ($items.length === 1) { return ButtonPosition.Standalone; } else if (index === 0) { - return ButtonPosition.Leftmost; + return ButtonPosition.InlineStart; } else if (index === $items.length - 1) { - return ButtonPosition.Rightmost; + return ButtonPosition.InlineEnd; } else { return ButtonPosition.Center; } @@ -98,7 +97,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html bind:this={buttonGroupRef} {id} class="btn-group {className}" - class:reverse {style} dir="ltr" role="group" @@ -118,8 +116,4 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html padding: calc(var(--buttons-size) / 10); margin: 0; } - - .reverse { - flex-direction: row-reverse; - } diff --git a/ts/components/ButtonGroupItem.svelte b/ts/components/ButtonGroupItem.svelte index a378bf45d..79d214469 100644 --- a/ts/components/ButtonGroupItem.svelte +++ b/ts/components/ButtonGroupItem.svelte @@ -22,19 +22,22 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html const radius = "5px"; + const leftStyle = `--border-left-radius: ${radius}; --border-right-radius: 0; `; + const rightStyle = `--border-left-radius: 0; --border-right-radius: ${radius}; `; + $: { switch (position_) { case ButtonPosition.Standalone: style = `--border-left-radius: ${radius}; --border-right-radius: ${radius}; `; break; - case ButtonPosition.Leftmost: - style = `--border-left-radius: ${radius}; --border-right-radius: 0; `; + case ButtonPosition.InlineStart: + style = leftStyle; break; case ButtonPosition.Center: style = "--border-left-radius: 0; --border-right-radius: 0; "; break; - case ButtonPosition.Rightmost: - style = `--border-left-radius: 0; --border-right-radius: ${radius}; `; + case ButtonPosition.InlineEnd: + style = rightStyle; break; } } diff --git a/ts/components/buttons.ts b/ts/components/buttons.ts index cd64bb1ca..9c57fc08f 100644 --- a/ts/components/buttons.ts +++ b/ts/components/buttons.ts @@ -5,9 +5,9 @@ import type { Registration } from "./registration"; export enum ButtonPosition { Standalone, - Leftmost, + InlineStart, Center, - Rightmost, + InlineEnd, } export interface ButtonRegistration extends Registration { diff --git a/ts/editor/HandleBackground.svelte b/ts/editor/HandleBackground.svelte index fb5f80561..fc6fc4eaf 100644 --- a/ts/editor/HandleBackground.svelte +++ b/ts/editor/HandleBackground.svelte @@ -11,11 +11,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html onMount(() => dispatch("mount", { background })); -
+