From b031e560af5f84ce64f0adbc0cef767371769426 Mon Sep 17 00:00:00 2001 From: Ilia Mashkov Date: Fri, 30 Jan 2026 00:56:21 +0300 Subject: [PATCH] feat(FontSampler): add delete button to remove font from the list of selected fonts, improve styling --- .../ui/FontSampler/FontSampler.svelte | 47 +++++++++++++++---- 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/src/features/DisplayFont/ui/FontSampler/FontSampler.svelte b/src/features/DisplayFont/ui/FontSampler/FontSampler.svelte index fa506f2..eba95fe 100644 --- a/src/features/DisplayFont/ui/FontSampler/FontSampler.svelte +++ b/src/features/DisplayFont/ui/FontSampler/FontSampler.svelte @@ -6,9 +6,15 @@ import { FontApplicator, type UnifiedFont, + selectedFontsStore, } from '$entities/Font'; import { controlManager } from '$features/SetupFont'; -import { ContentEditable } from '$shared/ui'; +import { cn } from '$shared/shadcn/utils/shadcn-utils'; +import { + ContentEditable, + IconButton, +} from '$shared/ui'; +import MinusIcon from '@lucide/svelte/icons/minus'; interface Props { /** @@ -33,18 +39,43 @@ let { ...restProps }: Props = $props(); -const weight = $derived(controlManager.weight ?? 400); +const fontWeight = $derived(controlManager.weight); +const fontSize = $derived(controlManager.size); +const lineHeight = $derived(controlManager.height); +const letterSpacing = $derived(controlManager.spacing); + +function removeSample() { + selectedFontsStore.removeOne(font.id); +}
- - - +
+ + {font.name} + + + {#snippet icon({ className })} + + {/snippet} + +
+
+ + + +