Иконки теперь могут быть чёрными
This commit is contained in:
parent
5856dc412b
commit
31d21b9c81
1 changed files with 7 additions and 2 deletions
|
@ -6,17 +6,22 @@
|
||||||
export let src: string | null = null;
|
export let src: string | null = null;
|
||||||
export let text: string;
|
export let text: string;
|
||||||
export let size: number = 32;
|
export let size: number = 32;
|
||||||
|
export let black: boolean = false;
|
||||||
|
|
||||||
let isUrl;
|
let isUrl;
|
||||||
$: isUrl = src?.startsWith('/') || src?.startsWith('http');
|
$: isUrl = src?.startsWith('/') || src?.startsWith('http');
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="{className} fill-slate-50 text-sm uppercase transition-all">
|
<div
|
||||||
|
class="{className} {black
|
||||||
|
? 'fill-slate-950'
|
||||||
|
: 'fill-slate-50'} text-sm uppercase transition-all"
|
||||||
|
>
|
||||||
{#if src}
|
{#if src}
|
||||||
{#if isUrl}
|
{#if isUrl}
|
||||||
<img {src} alt={text} width={size} height={size} />
|
<img {src} alt={text} width={size} height={size} />
|
||||||
{:else}
|
{:else}
|
||||||
<Icon width={size} height={size} icon={src} color="#f8fafc" />
|
<Icon width={size} height={size} icon={src} color={black ? '#020618' : '#f8fafc'} />
|
||||||
{/if}
|
{/if}
|
||||||
{:else}
|
{:else}
|
||||||
{text}
|
{text}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue