mirror of
https://github.com/acid-info/Kurate.git
synced 2025-01-27 08:04:45 +00:00
feat: add button component
This commit is contained in:
parent
2e579129b2
commit
7c9c4faf2f
30
src/lib/components/button.svelte
Normal file
30
src/lib/components/button.svelte
Normal file
@ -0,0 +1,30 @@
|
||||
<script lang="ts">
|
||||
export let variant: 'light' | 'dark' = 'light';
|
||||
</script>
|
||||
|
||||
<button class={`${variant} root`}>
|
||||
<slot />
|
||||
</button>
|
||||
|
||||
<style>
|
||||
.root {
|
||||
padding: 15px;
|
||||
border: 1px solid var(--color-black);
|
||||
border-radius: 50px;
|
||||
cursor: pointer;
|
||||
transition: 1s;
|
||||
}
|
||||
.light,
|
||||
.dark:hover {
|
||||
color: var(--color-black);
|
||||
background-color: var(--color-white);
|
||||
border-color: var(--color-light-grey);
|
||||
}
|
||||
|
||||
.dark,
|
||||
.light:hover {
|
||||
color: var(--color-white);
|
||||
background-color: var(--color-black);
|
||||
border-color: var(--color-light-black);
|
||||
}
|
||||
</style>
|
11
src/routes/+page.svelte
Normal file
11
src/routes/+page.svelte
Normal file
@ -0,0 +1,11 @@
|
||||
<script lang="ts">
|
||||
import './styles.css';
|
||||
import Header from '$lib/components/header.svelte';
|
||||
import Button from '$lib/components/button.svelte';
|
||||
</script>
|
||||
|
||||
<div>
|
||||
<Header />
|
||||
<Button>Light Button</Button>
|
||||
<Button variant="dark">Dark Button</Button>
|
||||
</div>
|
Loading…
x
Reference in New Issue
Block a user