refactor(features, widgets): update ThemeManager, FontSampler, FontSearch, and SampleList
This commit is contained in:
@@ -23,25 +23,10 @@ const { Story } = defineMeta({
|
||||
|
||||
<script lang="ts">
|
||||
import { themeManager } from '$features/ChangeAppTheme';
|
||||
import {
|
||||
onDestroy,
|
||||
onMount,
|
||||
} from 'svelte';
|
||||
|
||||
// Current theme state for display
|
||||
const currentTheme = $derived(themeManager.value);
|
||||
const themeSource = $derived(themeManager.source);
|
||||
const isDark = $derived(themeManager.isDark);
|
||||
|
||||
// Initialize themeManager on mount
|
||||
onMount(() => {
|
||||
themeManager.init();
|
||||
});
|
||||
|
||||
// Clean up themeManager when story unmounts
|
||||
onDestroy(() => {
|
||||
themeManager.destroy();
|
||||
});
|
||||
</script>
|
||||
|
||||
<Story name="Default">
|
||||
|
||||
@@ -18,9 +18,9 @@ const theme = $derived(themeManager.value);
|
||||
<IconButton onclick={() => themeManager.toggle()} size={responsive.isMobile ? 'sm' : 'md'} title="Toggle theme">
|
||||
{#snippet icon()}
|
||||
{#if theme === 'light'}
|
||||
<MoonIcon />
|
||||
<MoonIcon class={responsive.isMobile ? 'size-4' : 'size-5'} />
|
||||
{:else}
|
||||
<SunIcon />
|
||||
<SunIcon class={responsive.isMobile ? 'size-4' : 'size-5'} />
|
||||
{/if}
|
||||
{/snippet}
|
||||
</IconButton>
|
||||
|
||||
Reference in New Issue
Block a user