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