wip: making themes more dynamic and easy to add

This commit is contained in:
rasmusq
2025-11-30 01:30:43 +01:00
parent d165e5992a
commit 152bd7cdb1
12 changed files with 76 additions and 98 deletions

View File

@@ -1,23 +1,23 @@
<script lang="ts">
import CardPattern from './svgs/CardPattern.svelte';
import { getTheme, getThemeColor } from '$lib/utils/themes';
import { getTheme } from '$lib/utils/themes';
const patternOpacity = 0.1;
let {
themeName,
color
}: {
themeName?: string | null;
color?: string | null;
themeName?: string;
color?: string;
} = $props();
const theme = $derived(getTheme(themeName));
const themeColor = $derived(getThemeColor(color));
</script>
{#if theme.pattern !== 'none'}
<CardPattern
pattern={theme.pattern}
color={themeColor}
opacity={theme.opacity}
opacity={patternOpacity}
/>
{/if}