immich/web/src/lib/components/elements/buttons/circle-icon-button.svelte

35 lines
875 B
Svelte
Raw Normal View History

<script lang="ts">
import type Icon from 'svelte-material-icons/AbTesting.svelte';
export let logo: typeof Icon;
2022-09-08 17:30:49 +02:00
export let backgroundColor = 'transparent';
export let hoverColor = '#e2e7e9';
export let size = '24';
export let title = '';
export let isOpacity = false;
</script>
<button
{title}
style:background-color={backgroundColor}
style:--immich-icon-button-hover-color={hoverColor}
class="dark:text-immich-dark-fg rounded-full p-3 flex place-items-center place-content-center transition-all
{isOpacity
? 'hover:bg-immich-bg/30'
: 'immich-circle-icon-button hover:dark:text-immich-dark-gray'}"
on:click
>
2022-10-26 11:10:48 -05:00
<svelte:component this={logo} {size} />
<slot />
</button>
<style>
:root {
--immich-icon-button-hover-color: #d3d3d3;
}
.immich-circle-icon-button:hover {
background-color: var(--immich-icon-button-hover-color) !important;
}
</style>