feat: remake theme handling

This commit is contained in:
Xylight committed 2024-07-24 21:32:10 -07:00
1 parent 18d2e8fc1e
commit 3aa948891a
10 files changed
+413 -249

No files matched your search

+8 -2
View File
@@ -1,16 +1,22 @@
<script lang="ts">
export let backgroundColor: string = ''
import { hexToRgb } from '$lib/ui/colors'
import { createEventDispatcher } from 'svelte'
export let value: string
const dispatch = createEventDispatcher<{ change: string }>()
</script>
<div
class="w-full h-8 relative rounded-md border dark:border-zinc-600 hover:dark:border-zinc-400
transition-colors {$$props.class}"
style="background-color: {backgroundColor}"
style="background-color: rgb({value});"
>
<input
class="rounded-md border cursor-pointer absolute top-0 left-0 w-full h-full opacity-0"
type="color"
bind:value
on:change={() => dispatch('change', hexToRgb(value))}
on:contextmenu
/>
</div>