fix: margin in list mode

This commit is contained in:
Xylight committed 2024-06-03 13:56:36 -07:00
1 parent e569f0cf07
commit 33371fe640
3 files changed
+11 -7

No files matched your search

+6 -4
View File
@@ -50,7 +50,7 @@
<!-- svelte-ignore a11y-click-events-have-key-events -->
<Material
color={view != 'card' ? 'none' : 'distinct'}
class="relative max-w-full min-w-0 w-full group
class="relative max-w-full min-w-0 w-full
{view != 'card' ? 'bg-transparent !border-0' : 'p-5'} {view == 'compact'
? 'py-4 list-type'
: view == 'list'
@@ -96,7 +96,9 @@
<PostMediaCompact
{view}
bind:post={post.post}
class="{$userSettings.leftAlign ? 'mr-2' : 'ml-2'} flex-shrink"
class="{$userSettings.leftAlign
? 'mr-2'
: 'ml-2'} flex-shrink no-list-margin"
style="grid-area: media;"
/>
{/if}
@@ -141,7 +143,7 @@
grid-template-columns: var(--template-columns, 1fr auto);
}
:global(.list-type > *:not(:first-child)) {
padding-top: 0.5rem;
:global(.list-type > *:not(.no-list-margin):not(:first-child)) {
margin-top: 0.5rem;
}
</style>
@@ -109,7 +109,7 @@
</span>
<div
class="flex flex-row items-center overflow-auto gap-2 [&>*]:flex-shrink-0"
class="flex flex-row items-center self-center overflow-auto gap-2 [&>*]:flex-shrink-0"
style="grid-area: badges;"
>
{#if badges.nsfw}
@@ -11,7 +11,7 @@
{#if (view == 'list' || view == 'compact') && !post.embed_title && (post.thumbnail_url || isImage(post.url))}
<div
class="w-24 sm:w-32 h-24 {$$props.class ?? ''}"
class="w-24 sm:w-32 h-24 group/media {$$props.class ?? ''}"
style={$$props.style ?? ''}
>
<svelte:element
@@ -27,7 +27,9 @@
<img
src={bestImageURL(post, true)}
loading="lazy"
class="object-cover overflow-hidden bg-slate-100 dark:bg-zinc-800 rounded-xl h-24 w-24 sm:w-32 border border-slate-200 dark:border-zinc-800"
class="object-cover overflow-hidden bg-slate-100 dark:bg-zinc-800 rounded-xl h-24 w-24 sm:w-32
border border-slate-200 dark:border-zinc-800 group-hover/media:border-slate-400
group-hover/media:dark:border-zinc-600 transition-colors"
alt={post.name}
/>
</svelte:element>