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
+45 -113

No files matched your search

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