|
29 | 29 | import DrawerCodeBackgroundSection from "./drawer/DrawerCodeBackgroundSection.svelte"; |
30 | 30 | import DrawerLineNumbersSection from "./drawer/DrawerLineNumbersSection.svelte"; |
31 | 31 | import DimColorPicker from "./DimColorPicker.svelte"; |
32 | | - import { THEMES } from "$lib/lib/themes"; |
33 | 32 | import type { SettingsPatch } from "$lib/lib/tauri-api"; |
34 | 33 | import type { |
35 | 34 | GlobalAnimationKey, |
|
94 | 93 | let activeTab = $state<DrawerTab>("theme"); |
95 | 94 | let railEl: HTMLElement | undefined = $state(); |
96 | 95 | let resetConfirmOpen = $state(false); |
97 | | - let previewingThemeLabel: string | null = $state(null); |
98 | 96 |
|
99 | 97 | const previewProject = $derived(previewProjectSettings()); |
100 | 98 | const reduceMotion = $derived( |
|
106 | 104 | $effect(() => { |
107 | 105 | if (!open) { |
108 | 106 | clearPreviewProjectSetting("theme"); |
109 | | - previewingThemeLabel = null; |
110 | 107 | resetConfirmOpen = false; |
111 | 108 | } |
112 | 109 | }); |
|
209 | 206 |
|
210 | 207 | function handlePreviewTheme(theme: ThemeName) { |
211 | 208 | setPreviewProjectSetting("theme", theme); |
212 | | - previewingThemeLabel = |
213 | | - THEMES.find((candidate) => candidate.value === theme)?.label ?? theme; |
214 | 209 | } |
215 | 210 |
|
216 | 211 | function clearThemePreview() { |
217 | 212 | clearPreviewProjectSetting("theme"); |
218 | | - previewingThemeLabel = null; |
219 | 213 | } |
220 | 214 |
|
221 | 215 | function resetThemeSection() { |
|
289 | 283 | } |
290 | 284 | </script> |
291 | 285 |
|
292 | | -<span class="sr-only" aria-live="polite"> |
293 | | - {previewingThemeLabel ? `Previewing ${previewingThemeLabel}` : ""} |
294 | | -</span> |
295 | | - |
296 | 286 | <button |
297 | 287 | type="button" |
298 | 288 | aria-label="Close settings drawer" |
|
391 | 381 | </div> |
392 | 382 | </div> |
393 | 383 |
|
394 | | - {#if previewingThemeLabel} |
395 | | - <div |
396 | | - class="mx-4 mt-3 flex shrink-0 items-center justify-between rounded-full border border-primary/20 bg-primary/10 px-3 py-1.5 text-xs text-primary shadow-sm" |
397 | | - transition:fade={{ duration: reduceMotion ? 0 : 120 }} |
398 | | - > |
399 | | - <span class="font-medium">Previewing…</span> |
400 | | - <span class="min-w-0 truncate text-[11px] text-primary/80"> |
401 | | - {previewingThemeLabel} |
402 | | - </span> |
403 | | - </div> |
404 | | - {/if} |
405 | | - |
406 | 384 | <div class="flex min-h-0 flex-1"> |
407 | 385 | <div |
408 | 386 | bind:this={railEl} |
|
0 commit comments