From 0941e9246a05aed2fcb7c7355bfecdffd51dccd6 Mon Sep 17 00:00:00 2001 From: SquidSpirit Date: Mon, 28 Jul 2025 00:16:42 +0800 Subject: [PATCH] BLOG-87 fix: enhance typography and color consistency in PostPreview and PostContentPage & feat: add tailwind configuration for custom typography styles --- frontend/src/app.css | 1 + .../post/framework/ui/PostContentPage.svelte | 2 +- .../lib/post/framework/ui/PostPreview.svelte | 2 +- frontend/tailwind.config.js | 18 ++++++++++++++++++ 4 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 frontend/tailwind.config.js diff --git a/frontend/src/app.css b/frontend/src/app.css index 224a8cb..bc37462 100644 --- a/frontend/src/app.css +++ b/frontend/src/app.css @@ -1,5 +1,6 @@ @import 'tailwindcss'; @plugin '@tailwindcss/typography'; +@config "../tailwind.config.js"; @font-face { font-family: 'HackNerdMono'; diff --git a/frontend/src/lib/post/framework/ui/PostContentPage.svelte b/frontend/src/lib/post/framework/ui/PostContentPage.svelte index d8093b8..18f4a0e 100644 --- a/frontend/src/lib/post/framework/ui/PostContentPage.svelte +++ b/frontend/src/lib/post/framework/ui/PostContentPage.svelte @@ -16,7 +16,7 @@ onMount(() => postBloc.dispatch({ event: PostEventType.PostLoadedEvent, id: id })); -
+
{#if state.data}
diff --git a/frontend/src/lib/post/framework/ui/PostPreview.svelte b/frontend/src/lib/post/framework/ui/PostPreview.svelte index b4a4d0f..1a1b67d 100644 --- a/frontend/src/lib/post/framework/ui/PostPreview.svelte +++ b/frontend/src/lib/post/framework/ui/PostPreview.svelte @@ -34,7 +34,7 @@
- {postInfo.title} + {postInfo.title} {postInfo.description} {postInfo.formattedPublishedTime}
diff --git a/frontend/tailwind.config.js b/frontend/tailwind.config.js new file mode 100644 index 0000000..caa8dde --- /dev/null +++ b/frontend/tailwind.config.js @@ -0,0 +1,18 @@ +/** @type {import('tailwindcss').Config} */ +module.exports = { + theme: { + extend: { + typography: () => ({ + gray: { + css: { + '--tw-prose-body': 'var(--color-gray-700)', + '--tw-prose-headings': 'var(--color-gray-800)', + '--tw-prose-links': 'var(--color-gray-800)', + '--tw-prose-bold': 'var(--color-gray-800)', + '--tw-prose-quotes': 'var(--color-gray-800)' + } + } + }) + } + } +}; -- 2.47.2