impr: fixes for fonts, cleanup dead features (#563)

* cleanup: use tailwindcss classes

* design: de-emphasize unimportant terms in InboxItem

* fix: button shadow appearing in situations it shouldnt

* cleanup: remove tag rules

* fix: fonts not applying correctly

* fix: uncentered settings
This commit is contained in:
Xylight authored and GitHub committed 2025-06-10 12:51:00 -07:00
1 parent a7159b0526
commit 472b4b9190
15 files changed
+59 -127

No files matched your search

+1 -1
View File
@@ -31,7 +31,7 @@
{@const slctd = selected == option}
<button
class={[
'px-3 py-1 rounded-full text-sm font-medium transition-colors duration-75 relative',
'px-3 py-1 rounded-full text-sm font-medium transition-colors duration-75 relative cursor-pointer',
slctd
? 'bg-primary-900 dark:bg-primary-100 text-slate-50 dark:text-zinc-900'
: 'dark:bg-zinc-900/50 bg-white',
@@ -3,23 +3,21 @@
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
import { publishedToDate } from '$lib/components/util/date.js'
import { t } from '$lib/i18n/translations'
import { settings, type View } from '$lib/settings.svelte.js'
import type { CommentView } from 'lemmy-js-client'
import { Button, Material } from 'mono-svelte'
import { ArrowUturnUp, Icon } from 'svelte-hero-icons'
import type { ClassValue } from 'svelte/elements'
interface Props {
comment: CommentView
view?: View
community?: boolean
meta?: boolean
class?: string
commentClass?: string
commentClass?: ClassValue
}
let {
comment,
view = settings.view,
community = false,
meta = true,
class: clazz = '',
@@ -29,8 +27,7 @@
</script>
<Material
class="flex flex-col flex-1 rounded-none
{view == 'compact' ? 'py-4' : 'py-5'} {clazz}"
class={['flex flex-col flex-1 rounded-none py-4 list-none', clazz]}
color="none"
padding="none"
>
@@ -69,14 +66,12 @@
</Button>
</div>
{/if}
<div class="list-none">
<Comment
postId={comment.post.id}
node={{ children: [], comment_view: comment, depth: 1, expanded: true }}
replying={false}
{meta}
{...rest}
class={commentClass}
/>
</div>
<Comment
postId={comment.post.id}
node={{ children: [], comment_view: comment, depth: 1, expanded: true }}
replying={false}
{meta}
{...rest}
class={commentClass}
/>
</Material>
@@ -103,12 +103,7 @@
}
</script>
<ul
in:fly={{ duration: 500, easing: expoOut, y: -12, opacity: 0 }}
class={isParent
? 'divide-y dark:divide-zinc-900 divide-slate-100'
: ' border-slate-200 dark:border-zinc-800 my-1'}
>
<ul in:fly={{ duration: 500, easing: expoOut, y: -12, opacity: 0 }}>
{#each nodes as node, index (node.comment_view.comment.id)}
<Comment
postId={post.id}
@@ -117,7 +112,7 @@
contentClass="{node.children.length > 0 ||
node.comment_view.counts.child_count > 0
? 'border-l'
: ''} ml-2.5 border-slate-200 dark:border-zinc-800 pl-2.5 "
: ''} ml-2.5 border-slate-200 dark:border-zinc-800 pl-2.5"
bind:open={() => node.expanded, value => (node.expanded = value)}
>
{#if node.children?.length > 0}
@@ -136,6 +131,7 @@
rounding="pill"
color="tertiary"
class="font-normal text-sm! text-slate-600 dark:text-zinc-400"
shadow="none"
loaderWidth={16}
onclick={() => {
if (nodes[index].depth > 4) {
+1 -2
View File
@@ -21,8 +21,7 @@
let rule: 'blur-sm' | 'hide' | undefined
if (settings.nsfwBlur && (post.post.nsfw || post.community.nsfw))
rule = 'blur-sm'
tagContent.forEach(tag => {
if (settings.tagRules?.[tag]) rule = settings.tagRules?.[tag] ?? rule
tagContent.forEach(() => {
if (rule == 'hide') return rule
})
+1 -1
View File
@@ -149,7 +149,7 @@
rounding = size == 'lg' ? 'xl' : 'lg',
roundingSide = 'all',
alignment = 'center',
shadow = 'sm',
shadow = color != 'tertiary' ? 'sm' : 'none',
column = false,
disabled,
loaderWidth = undefined,
+1 -1
View File
@@ -17,7 +17,7 @@
</script>
<label
class="font-normal cursor-pointer flex flex-row items-start gap-4 group {clazz}"
class="font-normal cursor-pointer flex flex-row items-center gap-4 group {clazz}"
>
<div
class="w-11 h-6 rounded-full relative z-[inherit] cursor-pointer flex flex-row transition-colors shadow-xs
+1 -1
View File
@@ -73,7 +73,7 @@
placeholder = undefined,
label = undefined,
size = 'md',
shadow = 'none',
shadow = 'sm',
id = generateID(),
class: clazz = '',
baseClass = '',
-8
View File
@@ -96,9 +96,6 @@ interface Settings {
language: string | null
useRtl: boolean
parseTags: boolean
tagRules: {
[key: string]: 'hide' | 'blur-sm'
}
logoColorMonth: number | null
}
@@ -173,11 +170,6 @@ export const defaultSettings: Settings = {
language: env.PUBLIC_LANGUAGE ?? null,
useRtl: false,
parseTags: true,
tagRules: {
cw: 'blur-sm',
nsfl: 'blur-sm',
nsfw: 'blur-sm',
},
logoColorMonth: null,
}
+1 -23
View File
@@ -11,7 +11,7 @@
</script>
<Header pageHeader>{$t('routes.profile.media.title')}</Header>
<div class="media-grid">
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3">
{#each data.images as image (image.local_image.pictrs_delete_token)}
<div animate:flip={{ duration: 500, easing: expoInOut }}>
<PictrsImage
@@ -37,25 +37,3 @@
href={page => `?page=${page}`}
/>
{/if}
<style>
.media-grid {
display: grid;
grid-template-columns: 1fr;
gap: 1rem;
}
@media screen and (min-width: 768px) {
.media-grid {
display: grid;
grid-template-columns: 1fr 1fr;
}
}
@media screen and (min-width: 1024px) {
.media-grid {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
}
}
</style>
+9 -1
View File
@@ -1,4 +1,4 @@
import { profile } from '$lib/auth.svelte'
import { notifications, profile } from '$lib/auth.svelte'
import { publishedToDate } from '$lib/components/util/date.js'
import { getClient } from '$lib/lemmy.svelte.js'
import {
@@ -57,6 +57,14 @@ export async function load({ url, fetch }) {
publishedToDate(a.published).getTime(),
)
const totalNotifs = data.filter(i => !i.read).length
notifications.update(i => ({
applications: i.applications,
reports: i.reports,
inbox: totalNotifs,
}))
return {
unreadOnly: unreadOnly,
type: type,
+20 -10
View File
@@ -72,24 +72,24 @@
alt={item.creator.name}
/>
<div class="flex flex-col">
<div class="text-sm font-normal">
<div class="text-sm font-normal text-slate-600 dark:text-zinc-400">
{#if item.type == 'comment_reply'}
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
{@html $t('routes.inbox.item.reply', {
user: `<span class="font-medium">${item.creator.name}</span>`,
post: `<span class="font-medium">${escapeHtml(item.item.post.name)}</span>`,
user: `<strong>${item.creator.name}</strong>`,
post: `<strong>${escapeHtml(item.item.post.name)}</strong>`,
})}
{:else if item.type == 'person_mention'}
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
{@html $t('routes.inbox.item.mention', {
user: `<span class="font-medium">${item.creator.name}</span>`,
post: `<span class="font-medium">${escapeHtml(item.item.post.name)}</span>`,
user: `<strong>${item.creator.name}</strong>`,
post: `<strong>${escapeHtml(item.item.post.name)}</strong>`,
})}
{:else if item.type == 'private_message'}
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
{@html $t('routes.inbox.item.message', {
user: `<span class="font-medium">${item.item.creator.name}</span>`,
recipient: `<span class="font-medium">${item.item.recipient.name}</span>`,
user: `<strong>${item.item.creator.name}</strong>`,
recipient: `<strong>${item.item.recipient.name}</strong>`,
})}
{/if}
</div>
@@ -167,13 +167,23 @@
<CommentItem
comment={item.item}
community={false}
view="cozy"
meta={false}
commentClass="pt-0! pb-0"
class="pt-0"
class="py-0!"
commentClass="py-0!"
/>
{:else}
<PrivateMessage message={item.item} meta={false} />
{/if}
{/snippet}
</Expandable>
<style>
:global(strong) {
font-weight: 600;
color: var(--color-primary-900);
}
:global(.dark strong) {
color: var(--color-primary-100);
}
</style>
+1 -23
View File
@@ -11,7 +11,7 @@
</script>
<Header pageHeader>{$t('routes.admin.media.title')}</Header>
<div class="media-grid">
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3">
{#each data.images as image (image.local_image.pictrs_delete_token)}
<div animate:flip={{ duration: 500, easing: expoInOut }}>
<PictrsImage
@@ -36,25 +36,3 @@
href={page => `?page=${page}`}
/>
{/if}
<style>
.media-grid {
display: grid;
grid-template-columns: 1fr;
gap: 1rem;
}
@media screen and (min-width: 768px) {
.media-grid {
display: grid;
grid-template-columns: 1fr 1fr;
}
}
@media screen and (min-width: 1024px) {
.media-grid {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
}
}
</style>
+5 -29
View File
@@ -434,35 +434,11 @@
title={$t('settings.app.duplicateTitles.title')}
description={$t('settings.app.duplicateTitles.description')}
/>
<div>
<ToggleSetting
title={$t('settings.app.titleTags.title')}
description={$t('settings.app.titleTags.description')}
bind:checked={settings.parseTags}
/>
<Setting>
{#snippet title()}
{$t('settings.app.titleTags.rules.title')}
{/snippet}
<div
class="flex flex-col divide-y *:py-2 items-end divide-slate-200 dark:divide-zinc-800"
>
{#each Object.keys(settings.tagRules) as rule (rule)}
<div class="flex flex-row flex-wrap items-center gap-2">
<span class="text-lg font-medium">{rule}</span>
<MultiSelect
bind:selected={settings.tagRules[rule]}
options={['blur-sm', 'hide']}
optionNames={[
$t('settings.app.titleTags.rules.blur-sm'),
$t('settings.app.titleTags.rules.hide'),
]}
/>
</div>
{/each}
</div>
</Setting>
</div>
<ToggleSetting
title={$t('settings.app.titleTags.title')}
description={$t('settings.app.titleTags.description')}
bind:checked={settings.parseTags}
/>
</Section>
<Section id="embeds" title={$t('settings.embeds.title')}>
+3 -1
View File
@@ -74,7 +74,9 @@
class="flex flex-col @md/setting:flex-row items-center gap-2 {itemsClass}"
>
<div class="flex flex-col gap-0.5 flex-2 w-full shrink-0 min-w-48 {clazz}">
<h1 class="font-medium text-base">{@render title?.()}</h1>
<h1 class="font-medium text-base">
{@render title?.()}
</h1>
{#if description}
<div class="text-slate-600 dark:text-zinc-400 text-sm">
{@render description?.()}
+1 -3
View File
@@ -5,7 +5,6 @@
@custom-variant dark (&:is(.dark *));
@theme {
--font-*: initial;
--font-sans: sans-serif;
--font-system: system-ui;
--font-inter: Inter, system-ui, sans-serif;
@@ -123,8 +122,7 @@ body {
html,
body {
text-rendering: optimizeLegibility;
font-family: system-ui, sans-serif;
text-rendering: auto;
}
.wait * {