2021-12-30 19:28:43 +01:00
|
|
|
<script lang="ts">
|
|
|
|
import Icon from "./Icon.svelte";
|
|
|
|
|
|
|
|
export let name: string;
|
|
|
|
export let active = false;
|
|
|
|
export let disabled = false;
|
|
|
|
export let title: string | undefined = undefined;
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<button on:click class:active {disabled} {title}>
|
|
|
|
<Icon {name} />
|
|
|
|
</button>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
button {
|
|
|
|
border: 0;
|
|
|
|
background: transparent;
|
|
|
|
cursor: pointer;
|
|
|
|
color: inherit;
|
|
|
|
opacity: 0.66;
|
|
|
|
|
2022-01-03 22:31:51 +01:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
|
2021-12-30 19:28:43 +01:00
|
|
|
transition: opacity 0.2s, color 0.2s;
|
|
|
|
}
|
|
|
|
|
|
|
|
.active,
|
|
|
|
button:hover {
|
|
|
|
opacity: 1;
|
2021-12-30 23:24:38 +01:00
|
|
|
color: var(--active-color, var(--primary));
|
2021-12-30 19:28:43 +01:00
|
|
|
}
|
|
|
|
</style>
|