design: alternate background colors for even/odd comments
This commit is contained in:
4 files changed
+12
-8
No files matched your search
@@ -177,8 +177,9 @@
|
||||
>
|
||||
<Markdown
|
||||
source={node.comment_view.comment.content}
|
||||
noStyle
|
||||
class={[
|
||||
'text-[15px] text-slate-800 dark:text-zinc-200 leading-[1.3]',
|
||||
'text-base text-slate-700 dark:text-zinc-300 *:leading-[1.6] break-words space-y-3',
|
||||
|
||||
node.comment_view.comment.distinguished
|
||||
? 'bg-green-400/10 p-1 rounded-lg w-max font-medium'
|
||||
@@ -220,9 +221,7 @@
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="bg-transparent dark:bg-transparent">
|
||||
{@render children?.()}
|
||||
</div>
|
||||
{@render children?.()}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
@@ -41,14 +41,19 @@
|
||||
<div bind:this={offsetEl}>
|
||||
{#if offsetEl}
|
||||
<VirtualList
|
||||
class="divide-y divide-slate-200 dark:divide-zinc-800 w-full"
|
||||
class="divide-y divide-slate-100 dark:divide-zinc-900 -mx-3 sm:-mx-6"
|
||||
overscan={5}
|
||||
estimatedHeight={500}
|
||||
items={nodes}
|
||||
{initialOffset}
|
||||
>
|
||||
{#snippet item(index)}
|
||||
<div class="-mx-3 sm:-mx-6 px-3 sm:px-6">
|
||||
<div
|
||||
class={[
|
||||
'px-3 sm:px-6',
|
||||
index % 2 == 1 && 'bg-slate-25 dark:bg-zinc-950',
|
||||
]}
|
||||
>
|
||||
<Comments
|
||||
bind:nodes={() => [nodes[index]], v => (nodes[index] = v[0])}
|
||||
{post}
|
||||
|
||||
@@ -230,7 +230,7 @@
|
||||
{#each visibleItems as item (item.index)}
|
||||
<div
|
||||
data-index={item.index}
|
||||
class="post-container fix-divide"
|
||||
class="post-container fix-divide group/virtual"
|
||||
use:resizeObserver
|
||||
>
|
||||
{@render itemSnippet(item.index)}
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
transparent:
|
||||
'border border-slate-200 dark:border-zinc-900 border-b-slate-300 dark:border-t-zinc-800',
|
||||
uniform:
|
||||
'bg-white dark:bg-zinc-950 border border-slate-100 dark:border-zinc-900',
|
||||
'bg-white dark:bg-zinc-950 border border-slate-200 dark:border-zinc-900',
|
||||
none: '',
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user