gotobed zz

This commit is contained in:
Sveske_Juice 2024-02-22 03:04:32 +01:00
parent 81ffeaa780
commit 4d43f20a9c
2 changed files with 35 additions and 3 deletions

23
src/lib/IO/Button.svelte Normal file
View file

@ -0,0 +1,23 @@
<script lang="ts">
import { onMount } from "svelte";
export let text : string = 'button';
export let color : string;
onMount(() => {
if (!color || color.length === 0)
{
color = window.getComputedStyle(document.documentElement).getPropertyValue('--primary');
}
});
</script>
<button style="--button-color: {color};" class="button">
{text}
</button>
<style>
.button {
background-color: var(--button-color);
}
</style>