design: improve posts

This commit is contained in:
James Xylight committed 2025-08-21 17:16:18 -07:00
1 parent 930bb93282
commit d3ef22dac2
10 files changed
+67 -28

No files matched your search

@@ -85,7 +85,7 @@
<!--svelte-ignore a11y_no_static_element_interactions -->
<!--svelte-ignore a11y_click_events_have_key_events-->
<div
class="aspect-square w-max m-1 grid place-items-center text-slate-600 dark:text-zinc-400"
class="aspect-square w-max m-1 grid place-items-center"
onclick={e => e.stopPropagation()}
>
{#if !post.post.local}
@@ -98,7 +98,12 @@
class="w-full h-full"
>
{#snippet prefix()}
<Icon src={EllipsisHorizontal} size="16" micro />
<Icon
src={EllipsisHorizontal}
size="16"
micro
class="text-slate-600 dark:text-zinc-400"
/>
{/snippet}
</Button>
{/snippet}
+37 -5
View File
@@ -1,20 +1,52 @@
<script lang="ts">
import type { ClassValue } from 'svelte/elements'
const sizes = {
sm: 'text-sm',
md: 'text-base',
lg: 'text-lg',
}
const colors = {
subtle: 'text-slate-600 dark:text-zinc-400',
none: '',
}
interface Props {
class?: string
class?: ClassValue
size?: keyof typeof sizes
color?: keyof typeof colors
border?: boolean
children?: import('svelte').Snippet
action?: import('svelte').Snippet
}
let { class: clazz = '', children, action }: Props = $props()
let {
class: clazz = '',
children,
action,
border = true,
size = 'sm',
color = 'subtle',
}: Props = $props()
</script>
<div
class="flex flex-row items-center
text-sm text-slate-600 dark:text-zinc-400 gap-2 flex-wrap {clazz}"
class={[
'flex flex-row items-center gap-2 flex-wrap',
sizes[size],
colors[color],
clazz,
]}
>
<span class="font-medium text-left">
{@render children?.()}
</span>
<div class="flex-1"></div>
<hr
class={[
'flex-1 border-slate-200 dark:border-zinc-800',
!border && 'opacity-0',
]}
/>
{@render action?.()}
</div>
+3 -3
View File
@@ -97,7 +97,7 @@
>
{#snippet title()}
<span class="px-2 py-1 w-full">
<EndPlaceholder>
<EndPlaceholder border={false}>
{$t('account.accounts')}
{#snippet action()}
<span class="dark:text-white text-black">
@@ -134,7 +134,7 @@
>
{#snippet title()}
<span class="px-2 py-1 w-full">
<EndPlaceholder>
<EndPlaceholder border={false}>
{$t('routes.profile.moderates')}
{#snippet action()}
<span class="dark:text-white text-black">
@@ -185,7 +185,7 @@
>
{#snippet title()}
<span class="px-2 py-1 w-full">
<EndPlaceholder>
<EndPlaceholder border={false}>
{$t('profile.subscribed')}
{#snippet action()}
<span class="dark:text-white text-black">