design: use commonlist for settings and moderation
This commit is contained in:
7 files changed
+119
-114
No files matched your search
@@ -62,11 +62,11 @@
|
||||
loading="lazy"
|
||||
srcset="{optimizedURLs[0]} 1x, {optimizedURLs[1]} 2x, {optimizedURLs[2]} 4x, {optimizedURLs[3]} 6x"
|
||||
src={optimizedURLs[0]}
|
||||
{alt}
|
||||
alt=""
|
||||
{width}
|
||||
{title}
|
||||
class={[
|
||||
'aspect-square object-cover overflow-hidden shrink-0',
|
||||
'aspect-square object-cover overflow-hidden shrink-0 bg-slate-100 dark:bg-zinc-900',
|
||||
circle ? 'rounded-full' : 'rounded-lg',
|
||||
clazz,
|
||||
]}
|
||||
@@ -114,10 +114,3 @@
|
||||
}).toString()}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
img,
|
||||
div {
|
||||
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><line x1="30" y1="30" x2="70" y2="70" stroke="#aa0000" stroke-width="4" stroke-linecap="round"/><line x1="70" y1="30" x2="30" y2="70" stroke="#aa0000" stroke-width="4" stroke-linecap="round"/></svg>');
|
||||
}
|
||||
</style>
|
||||
@@ -2,23 +2,59 @@
|
||||
import type { Snippet } from 'svelte'
|
||||
|
||||
interface Props {
|
||||
items: T[]
|
||||
item: Snippet<[T, number]>
|
||||
items?: T[]
|
||||
item?: Snippet<[T, number]>
|
||||
children?: Snippet
|
||||
}
|
||||
|
||||
let { items, item: itemSnippet }: Props = $props()
|
||||
let { items, item: itemSnippet, children }: Props = $props()
|
||||
</script>
|
||||
|
||||
<ul class="divide-y-3 divide-slate-25 dark:divide-zinc-925">
|
||||
{#each items as item, index (item)}
|
||||
<li
|
||||
class={[
|
||||
'py-2 px-3 sm:py-3 sm:px-4',
|
||||
'hover:bg-slate-100 dark:hover:bg-zinc-900/25 transition-colors @container',
|
||||
'bg-slate-50 dark:bg-zinc-950 first:rounded-t-2xl last:rounded-b-2xl group/li',
|
||||
]}
|
||||
>
|
||||
{@render itemSnippet(item, index)}
|
||||
</li>
|
||||
{/each}
|
||||
{#if items}
|
||||
{#each items as item, index (item)}
|
||||
<li class="@container group/li">
|
||||
{@render itemSnippet?.(item, index)}
|
||||
</li>
|
||||
{/each}
|
||||
{/if}
|
||||
{@render children?.()}
|
||||
</ul>
|
||||
|
||||
<style>
|
||||
ul > :global(li) {
|
||||
padding-block: calc(var(--spacing) * 2);
|
||||
padding-inline: calc(var(--spacing) * 3);
|
||||
transition: background-color 0.1s;
|
||||
background-color: var(--color-slate-50);
|
||||
container-type: inline-size;
|
||||
|
||||
&:first-child {
|
||||
border-top-left-radius: var(--radius-2xl);
|
||||
border-top-right-radius: var(--radius-2xl);
|
||||
}
|
||||
&:last-child {
|
||||
border-bottom-left-radius: var(--radius-2xl);
|
||||
border-bottom-right-radius: var(--radius-2xl);
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: var(--color-zinc-50);
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 40rem) {
|
||||
ul > :global(li) {
|
||||
padding-block: calc(var(--spacing) * 2);
|
||||
padding-inline: calc(var(--spacing) * 3);
|
||||
}
|
||||
}
|
||||
|
||||
:global(.dark) ul > :global(li) {
|
||||
background-color: var(--color-zinc-950);
|
||||
|
||||
&:hover {
|
||||
background-color: var(--color-zinc-900);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user