design: update comment sizing
This commit is contained in:
9 files changed
+23
-31
No files matched your search
@@ -208,8 +208,7 @@
|
|||||||
source={node.comment_view.comment.content}
|
source={node.comment_view.comment.content}
|
||||||
noStyle
|
noStyle
|
||||||
class={[
|
class={[
|
||||||
'text-base text-slate-700 dark:text-zinc-300 *:leading-[1.6] break-words space-y-3',
|
'text-[14px] sm:text-base text-slate-700 dark:text-zinc-300 *:leading-[1.6] break-words space-y-3',
|
||||||
|
|
||||||
node.comment_view.comment.distinguished
|
node.comment_view.comment.distinguished
|
||||||
? 'bg-green-400/10 p-2 rounded-xl max-w-max font-medium'
|
? 'bg-green-400/10 p-2 rounded-xl max-w-max font-medium'
|
||||||
: page.url.hash.slice(1) ==
|
: page.url.hash.slice(1) ==
|
||||||
|
|||||||
@@ -79,7 +79,7 @@
|
|||||||
{@render passedTarget(acting)}
|
{@render passedTarget(acting)}
|
||||||
{/snippet}
|
{/snippet}
|
||||||
{#if (profile.current?.user && amMod(profile.current.user, item.community)) || (profile.current?.user && isAdmin(profile.current.user))}
|
{#if (profile.current?.user && amMod(profile.current.user, item.community)) || (profile.current?.user && isAdmin(profile.current.user))}
|
||||||
<MenuDivider>
|
<MenuDivider showLabel>
|
||||||
{#if !item.community.local && !amMod(profile.current.user, item.community)}
|
{#if !item.community.local && !amMod(profile.current.user, item.community)}
|
||||||
{$t('moderation.labelInstanceOnly')}
|
{$t('moderation.labelInstanceOnly')}
|
||||||
{:else}
|
{:else}
|
||||||
|
|||||||
@@ -129,7 +129,7 @@
|
|||||||
}: Props = $props()
|
}: Props = $props()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
@component
|
@component
|
||||||
This component will build two different things: a post's meta block and the title.
|
This component will build two different things: a post's meta block and the title.
|
||||||
-->
|
-->
|
||||||
@@ -337,7 +337,7 @@
|
|||||||
class={[
|
class={[
|
||||||
'inline max-sm:mt-0!',
|
'inline max-sm:mt-0!',
|
||||||
'hover:underline hover:text-primary-900 dark:hover:text-primary-100 transition-colors',
|
'hover:underline hover:text-primary-900 dark:hover:text-primary-100 transition-colors',
|
||||||
'font-medium',
|
'font-medium text-balance max-w-xl',
|
||||||
titleClass,
|
titleClass,
|
||||||
settings.markReadPosts && read && 'text-slate-600 dark:text-zinc-400',
|
settings.markReadPosts && read && 'text-slate-600 dark:text-zinc-400',
|
||||||
view == 'compact' ? 'text-base' : 'text-lg',
|
view == 'compact' ? 'text-base' : 'text-lg',
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="text-slate-700 dark:text-zinc-300 flex flex-col w-max mx-auto items-center gap-4 {clazz}"
|
class="text-slate-500 dark:text-zinc-500 contrast-more:text-slate-700 contrast-more:dark:text-zinc-300 flex flex-col w-max mx-auto items-center gap-4 {clazz}"
|
||||||
>
|
>
|
||||||
<div class="flex flex-col gap-2 items-center max-w-sm">
|
<div class="flex flex-col gap-2 items-center max-w-sm">
|
||||||
{#if icon}
|
{#if icon}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
>
|
>
|
||||||
{@render navbar?.({
|
{@render navbar?.({
|
||||||
class: [
|
class: [
|
||||||
'bg-slate-100/50 dark:bg-zinc-950/90 border-slate-200/50 dark:border-zinc-900',
|
'bg-slate-100/70 dark:bg-zinc-950/90 border-slate-200/50 dark:border-zinc-900',
|
||||||
'pointer-events-auto backdrop-blur-xl border lg:border-t-0 lg:border-x-0',
|
'pointer-events-auto backdrop-blur-xl border lg:border-t-0 lg:border-x-0',
|
||||||
'rounded-full lg:rounded-none',
|
'rounded-full lg:rounded-none',
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
'hover:text-slate-900 dark:hover:text-zinc-50 transition-colors',
|
'hover:text-slate-900 dark:hover:text-zinc-50 transition-colors',
|
||||||
isSelected
|
isSelected
|
||||||
? 'text-primary-900 dark:text-primary-100 max-lg:bg-slate-100 max-lg:dark:bg-zinc-800'
|
? 'text-primary-900 dark:text-primary-100 max-lg:bg-slate-100 max-lg:dark:bg-zinc-800'
|
||||||
: 'text-slate-600 dark:text-zinc-400',
|
: 'text-slate-500 dark:text-zinc-400',
|
||||||
clazz,
|
clazz,
|
||||||
]}
|
]}
|
||||||
shadow="none"
|
shadow="none"
|
||||||
|
|||||||
@@ -53,7 +53,6 @@
|
|||||||
</Modal>
|
</Modal>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<MenuDivider>{$t('nav.menu.label')}</MenuDivider>
|
|
||||||
{#if profile.current?.jwt}
|
{#if profile.current?.jwt}
|
||||||
<MenuButton href="/profile">
|
<MenuButton href="/profile">
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
@@ -146,7 +145,6 @@
|
|||||||
Debug
|
Debug
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
<MenuDivider />
|
|
||||||
<li class="flex flex-col px-2 py-1 mx-auto my-1 text-xs w-full">
|
<li class="flex flex-col px-2 py-1 mx-auto my-1 text-xs w-full">
|
||||||
<div class="flex flex-row gap-2 w-full items-center">
|
<div class="flex flex-row gap-2 w-full items-center">
|
||||||
<div class="flex-1">
|
<div class="flex-1">
|
||||||
@@ -161,7 +159,10 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<Button
|
<Button
|
||||||
onclick={() => (showInstance = !showInstance)}
|
onclick={e => {
|
||||||
|
e.stopPropagation()
|
||||||
|
showInstance = !showInstance
|
||||||
|
}}
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
title={$t('nav.menu.instance')}
|
title={$t('nav.menu.instance')}
|
||||||
size="square-md"
|
size="square-md"
|
||||||
|
|||||||
@@ -1,12 +1,20 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
let { children } = $props()
|
import type { Snippet } from 'svelte'
|
||||||
|
|
||||||
|
let {
|
||||||
|
showLabel = false,
|
||||||
|
children,
|
||||||
|
}: { showLabel?: boolean; children: Snippet } = $props()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="text-slate-800 dark:text-zinc-200 text-xs font-medium m-3 my-2 mb-1 flex items-center gap-1"
|
class="text-slate-800 dark:text-zinc-200 text-xs font-medium m-3 my-2 mb-1 flex items-center gap-1"
|
||||||
>
|
>
|
||||||
<div class="sr-only">{@render children?.()}</div>
|
<div class={[!showLabel && 'sr-only']}>{@render children?.()}</div>
|
||||||
<hr
|
<hr
|
||||||
class="shrink flex-1 border-slate-100 dark:border-zinc-800 border-opacity-70 -mx-4"
|
class={[
|
||||||
|
'shrink flex-1 border-slate-100 dark:border-zinc-800',
|
||||||
|
!showLabel && '-mx-4',
|
||||||
|
]}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -68,30 +68,14 @@
|
|||||||
strategy: strategy,
|
strategy: strategy,
|
||||||
placement: placement,
|
placement: placement,
|
||||||
middleware: middleware,
|
middleware: middleware,
|
||||||
onComputed: ({ x, y, placement }) => {
|
onComputed: ({ placement }) => {
|
||||||
if (popoverEl) {
|
if (popoverEl) {
|
||||||
popoverEl.style.transformOrigin = origins[placement]
|
popoverEl.style.transformOrigin = origins[placement]
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(placement)
|
|
||||||
|
|
||||||
// @ts-expect-error svelte hell
|
|
||||||
Object.assign(el?.children?.item?.(0) ?? el, {
|
|
||||||
top: '0',
|
|
||||||
left: '0',
|
|
||||||
transform: `translate3d(${roundByDPR(x)}px,${roundByDPR(y)}px,0)`,
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
function roundByDPR(value: number) {
|
|
||||||
const dpr = window.devicePixelRatio || 1
|
|
||||||
return Math.round(value * dpr) / dpr
|
|
||||||
}
|
|
||||||
|
|
||||||
const customFloatingContent = (node: HTMLDivElement) => {
|
const customFloatingContent = (node: HTMLDivElement) => {
|
||||||
// if (!canUseContents) return
|
|
||||||
|
|
||||||
floatingContent(node)
|
floatingContent(node)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user