impr: optimize styles to use cssx

This commit is contained in:
James Xylight committed 2025-07-30 15:45:27 -07:00
1 parent f733b57f60
commit 83bf97fed0
5 files changed
+25 -31

No files matched your search

+4 -3
View File
@@ -38,9 +38,10 @@
src={open ? Minus : Plus} src={open ? Minus : Plus}
size="16" size="16"
micro micro
class="{open class={[
? '' open && 'rotate-90',
: 'rotate-90'} transition-transform duration-300 ease-out" 'transition-transform duration-300 ease-out',
]}
/> />
{/if} {/if}
<div <div
+1 -1
View File
@@ -97,7 +97,7 @@
} }
} }
@media (min-width: 1280px) { @media (min-width: 80rem) {
.content { .content {
grid-template-columns: 20% 60% 20%; grid-template-columns: 20% 60% 20%;
justify-items: end center start; justify-items: end center start;
@@ -18,9 +18,7 @@
</script> </script>
<SidebarButton <SidebarButton
alignment="left"
loading={switching} loading={switching}
rounding="lg"
loaderWidth={22} loaderWidth={22}
selected={profile.current?.id == prof.id} selected={profile.current?.id == prof.id}
onclick={async () => { onclick={async () => {
@@ -47,9 +45,10 @@
/> />
{/snippet} {/snippet}
<span <span
class="inline-flex flex-col gap-0 {profile.current?.id == prof.id class={[
? 'font-semibold' 'inline-flex flex-col gap-0',
: ''}" profile.current?.id == prof.id && 'font-semibold',
]}
> >
{prof.username ?? prof.user?.local_user_view.person.name} {prof.username ?? prof.user?.local_user_view.person.name}
{#if !guest && !LINKED_INSTANCE_URL} {#if !guest && !LINKED_INSTANCE_URL}
+15 -21
View File
@@ -34,29 +34,25 @@
{#if profile.current?.jwt} {#if profile.current?.jwt}
<SidebarButton icon={UserCircle} href="/profile"> <SidebarButton icon={UserCircle} href="/profile">
{#snippet label()} {#snippet label()}
<span> {$t('profile.profile')}
{$t('profile.profile')}
</span>
{/snippet} {/snippet}
</SidebarButton> </SidebarButton>
<SidebarButton icon={Inbox} href="/inbox"> <SidebarButton icon={Inbox} href="/inbox">
{#snippet label()} {#snippet label()}
<span class="flex items-center gap-2"> {$t('profile.inbox')}
{$t('profile.inbox')} {#if $notifications.inbox}
{#if $notifications.inbox} <Badge
<Badge class="min-w-5 h-5 p-0! px-0.5 grid place-items-center ml-auto"
class="min-w-5 h-5 p-0! px-0.5 grid place-items-center ml-auto" color="red-subtle"
color="red-subtle" >
> {$notifications.inbox > 99 ? '∞' : $notifications.inbox}
{$notifications.inbox > 99 ? '∞' : $notifications.inbox} </Badge>
</Badge> {/if}
{/if}
</span>
{/snippet} {/snippet}
</SidebarButton> </SidebarButton>
<SidebarButton icon={Bookmark} href="/saved"> <SidebarButton icon={Bookmark} href="/saved">
{#snippet label()} {#snippet label()}
<span>{$t('profile.saved')}</span> {$t('profile.saved')}
{/snippet} {/snippet}
</SidebarButton> </SidebarButton>
{:else} {:else}
@@ -66,7 +62,7 @@
icon={ArrowLeftOnRectangle} icon={ArrowLeftOnRectangle}
> >
{#snippet label()} {#snippet label()}
<span>{$t('account.login')}</span> {$t('account.login')}
{/snippet} {/snippet}
</SidebarButton> </SidebarButton>
<SidebarButton <SidebarButton
@@ -75,7 +71,7 @@
icon={Identification} icon={Identification}
> >
{#snippet label()} {#snippet label()}
<span>{$t('account.signup')}</span> {$t('account.signup')}
{/snippet} {/snippet}
</SidebarButton> </SidebarButton>
<SidebarButton <SidebarButton
@@ -84,7 +80,7 @@
icon={Cog6Tooth} icon={Cog6Tooth}
> >
{#snippet label()} {#snippet label()}
<span>{$t('nav.menu.settings')}</span> {$t('nav.menu.settings')}
{/snippet} {/snippet}
</SidebarButton> </SidebarButton>
{/if} {/if}
@@ -109,9 +105,7 @@
{/snippet} {/snippet}
<div class="w-full flex gap-px flex-col"> <div class="w-full flex gap-px flex-col">
{#each [...profile.meta.profiles] as prof, index} {#each [...profile.meta.profiles] as prof, index}
<div class="w-full"> <ProfileButton {index} {prof} />
<ProfileButton {index} {prof} />
</div>
{/each} {/each}
</div> </div>
<SidebarButton href="/accounts" icon={UserGroup}> <SidebarButton href="/accounts" icon={UserGroup}>
+1 -1
View File
@@ -125,7 +125,7 @@
{...rest} {...rest}
tabindex={disabled || loading ? -1 : undefined} tabindex={disabled || loading ? -1 : undefined}
class={[ class={[
loading ? buttonColor.secondary : buttonColor[color], buttonColor[color],
buttonSize[size], buttonSize[size],
buttonRounding[rounding], buttonRounding[rounding],
buttonShadow[shadow], buttonShadow[shadow],