gotobed zz
This commit is contained in:
parent
81ffeaa780
commit
4d43f20a9c
2 changed files with 35 additions and 3 deletions
23
src/lib/IO/Button.svelte
Normal file
23
src/lib/IO/Button.svelte
Normal 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>
|
Loading…
Add table
Add a link
Reference in a new issue