🛠️ Upgrade custom icons props

This commit is contained in:
pheralb 2025-01-31 09:33:34 +00:00
parent 6598247779
commit 83845e2dd3
9 changed files with 44 additions and 16 deletions

View File

@ -1,5 +1,6 @@
<script lang="ts">
export let iconSize: number;
import type { IconProps } from '@/types/icons';
let { iconSize }: IconProps = $props();
</script>
<svg

View File

@ -1,5 +1,6 @@
<script lang="ts">
export let iconSize: number;
import type { IconProps } from '@/types/icons';
let { iconSize }: IconProps = $props();
</script>
<svg

View File

@ -1,5 +1,11 @@
<script lang="ts">
import type { IconProps } from '@/types/icons';
let { iconSize }: IconProps = $props();
</script>
<svg
width="30"
width={iconSize || 30}
height={iconSize || 30}
name="SVGL Logo"
viewBox="0 0 512 512"
fill="none"

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -1,6 +1,6 @@
<script lang="ts">
export let iconSize: number;
export let className: string;
import type { IconProps } from '@/types/icons';
let { iconSize, className }: IconProps = $props();
</script>
<svg

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,6 @@
<script lang="ts">
export let iconSize: number;
import type { IconProps } from '@/types/icons';
let { iconSize, color }: IconProps = $props();
</script>
<svg

View File

@ -1,5 +1,6 @@
<script lang="ts">
export let iconSize: number;
import type { IconProps } from '@/types/icons';
let { iconSize }: IconProps = $props();
</script>
<svg

View File

@ -1,5 +1,6 @@
<script lang="ts">
export let iconSize: number;
import type { IconProps } from '@/types/icons';
let { iconSize }: IconProps = $props();
</script>
<svg

5
src/types/icons.ts Normal file
View File

@ -0,0 +1,5 @@
export interface IconProps {
iconSize: number;
className?: string;
color?: string;
}