mirror of
https://github.com/Lapikud/lapikud.github.io.git
synced 2026-08-08 18:09:13 +00:00
23 lines
545 B
Svelte
23 lines
545 B
Svelte
<script>
|
|
export let onClick = () => {};
|
|
export let buttonHoverStyle = "";
|
|
|
|
let isHovered = false;
|
|
</script>
|
|
|
|
<button
|
|
on:click={onClick}
|
|
on:mouseenter={() => (isHovered = true)}
|
|
on:mouseleave={() => (isHovered = false)}
|
|
class={`btn border-[1.5px] px-5 py-2.5 font-medium cursor-pointer flex items-center gap-2 whitespace-nowrap ${$$restProps.class}`}
|
|
style={isHovered && buttonHoverStyle ? buttonHoverStyle : null}
|
|
>
|
|
<slot />
|
|
</button>
|
|
|
|
<style>
|
|
.btn {
|
|
transition: background-color 0.2s ease, color 0.2s ease;
|
|
}
|
|
</style>
|