Add: CardIcon Component

This commit is contained in:
Donatas Kirda 2024-05-20 22:54:42 +03:00
parent 9fa4655632
commit 331c9e42ec
Signed by: bloodwiing
GPG Key ID: 63020D8D3F4A164F
2 changed files with 43 additions and 0 deletions

View File

@ -23,6 +23,7 @@
&[data-horizontal] { &[data-horizontal] {
flex-direction: row; flex-direction: row;
gap: 16px;
} }
} }
</style> </style>

42
src/comp/cardicon.svelte Normal file
View File

@ -0,0 +1,42 @@
<script>
import Card from "./card.svelte";
import Tablericon from "./tablericon.svelte";
/**
* @type {string}
*/
export let colorIcon = "var(--gray)";
/**
* @type {string}
*/
export let colorBackground = "var(--gray-dim)";
/**
* @type {string}
*/
export let iconName;
/**
* @type {number}
*/
export let iconSize = 24;
</script>
<style>
.icon {
display: flex;
background: var(--card-bg);
padding: 8px;
border-radius: 8px;
aspect-ratio: 1 / 1;
height: 100%;
}
</style>
<Card horizontal={true} background={colorBackground}>
<div class="icon">
<Tablericon color={colorIcon} name={iconName} size={iconSize}></Tablericon>
</div>
<slot />
</Card>