From 83bf97fed045a76cd98e80cb4846683da6564e52 Mon Sep 17 00:00:00 2001 From: James Xylight Date: Wed, 30 Jul 2025 15:45:27 -0700 Subject: [PATCH] impr: optimize styles to use cssx --- src/lib/components/ui/Expandable.svelte | 7 ++-- src/lib/components/ui/layout/Shell.svelte | 2 +- .../ui/sidebar/ProfileButton.svelte | 9 +++-- src/lib/components/ui/sidebar/Sidebar.svelte | 36 ++++++++----------- src/lib/mono/button/Button.svelte | 2 +- 5 files changed, 25 insertions(+), 31 deletions(-) diff --git a/src/lib/components/ui/Expandable.svelte b/src/lib/components/ui/Expandable.svelte index 82e545cc..8da23450 100644 --- a/src/lib/components/ui/Expandable.svelte +++ b/src/lib/components/ui/Expandable.svelte @@ -38,9 +38,10 @@ src={open ? Minus : Plus} size="16" micro - class="{open - ? '' - : 'rotate-90'} transition-transform duration-300 ease-out" + class={[ + open && 'rotate-90', + 'transition-transform duration-300 ease-out', + ]} /> {/if}
{ @@ -47,9 +45,10 @@ /> {/snippet} {prof.username ?? prof.user?.local_user_view.person.name} {#if !guest && !LINKED_INSTANCE_URL} diff --git a/src/lib/components/ui/sidebar/Sidebar.svelte b/src/lib/components/ui/sidebar/Sidebar.svelte index 6403e942..2188002b 100644 --- a/src/lib/components/ui/sidebar/Sidebar.svelte +++ b/src/lib/components/ui/sidebar/Sidebar.svelte @@ -34,29 +34,25 @@ {#if profile.current?.jwt} {#snippet label()} - - {$t('profile.profile')} - + {$t('profile.profile')} {/snippet} {#snippet label()} - - {$t('profile.inbox')} - {#if $notifications.inbox} - - {$notifications.inbox > 99 ? '∞' : $notifications.inbox} - - {/if} - + {$t('profile.inbox')} + {#if $notifications.inbox} + + {$notifications.inbox > 99 ? '∞' : $notifications.inbox} + + {/if} {/snippet} {#snippet label()} - {$t('profile.saved')} + {$t('profile.saved')} {/snippet} {:else} @@ -66,7 +62,7 @@ icon={ArrowLeftOnRectangle} > {#snippet label()} - {$t('account.login')} + {$t('account.login')} {/snippet} {#snippet label()} - {$t('account.signup')} + {$t('account.signup')} {/snippet} {#snippet label()} - {$t('nav.menu.settings')} + {$t('nav.menu.settings')} {/snippet} {/if} @@ -109,9 +105,7 @@ {/snippet}
{#each [...profile.meta.profiles] as prof, index} -
- -
+ {/each}
diff --git a/src/lib/mono/button/Button.svelte b/src/lib/mono/button/Button.svelte index d5b9a6e3..70f3f22c 100644 --- a/src/lib/mono/button/Button.svelte +++ b/src/lib/mono/button/Button.svelte @@ -125,7 +125,7 @@ {...rest} tabindex={disabled || loading ? -1 : undefined} class={[ - loading ? buttonColor.secondary : buttonColor[color], + buttonColor[color], buttonSize[size], buttonRounding[rounding], buttonShadow[shadow],