misc: fix markdown fonts

This commit is contained in:
Xyphyn committed 2023-09-14 17:22:15 -07:00
1 parent c4d2b2bf2a
commit 360fe8cc8c
2 files changed
+12 -2

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "photon-lemmy", "name": "photon-lemmy",
"version": "1.6.1", "version": "1.6.2",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite dev", "dev": "vite dev",
+11 -1
View File
@@ -1,5 +1,6 @@
<script lang="ts"> <script lang="ts">
import { md, mdInline, photonify } from '$lib/components/markdown/markdown' import { md, mdInline, photonify } from '$lib/components/markdown/markdown'
import { userSettings } from '$lib/settings.js'
export let source: string = '' export let source: string = ''
export let inline: boolean = false export let inline: boolean = false
@@ -18,11 +19,20 @@
$: if (source && div) { $: if (source && div) {
replaceURLs(div) replaceURLs(div)
} }
let font =
$userSettings.font == 'system'
? 'font-system'
: $userSettings.font == 'browser'
? 'font-sans'
: inline
? 'font-inter'
: 'font-system'
</script> </script>
<div <div
bind:this={div} bind:this={div}
class="break-words flex flex-col markdown gap-2 leading-[1.5] font-sans" class="break-words flex flex-col markdown gap-2 leading-[1.5] {font}"
> >
{#if inline} {#if inline}
{@html mdInline.render(source)} {@html mdInline.render(source)}