Improve article rendering.

This commit is contained in:
2025-06-03 16:02:57 +08:00
parent 486db58e46
commit 38d5bd3242
2 changed files with 12 additions and 8 deletions

View File

@@ -4,24 +4,28 @@ article {
} }
h1 { h1 {
font-size: 24px;
font-weight: bold;
padding: 12px 0;
margin: 24px 0 12px;
}
h2 {
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
padding: 12px 0; padding: 12px 0;
} margin: 16px 0 8px;
h2 {
font-size: 18px;
font-weight: bold;
padding: 10px 0;
} }
h3 { h3 {
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
padding: 8px 0; padding: 6px 0;
margin: 12px 0 4px;
} }
h4 { h4 {
font-size: 14px; font-size: 14px;
font-weight: bold; font-weight: bold;
padding: 6px 0; padding: 6px 0;
margin: 12px 0 4px;
} }
h5 { h5 {
font-size: 12px; font-size: 12px;
@@ -36,7 +40,7 @@ article {
p { p {
font-size: 14px; font-size: 14px;
line-height: 1.6; line-height: 1.6;
margin: 8px 0; margin: 12px 0;
} }
ul { ul {
list-style-type: disc; list-style-type: disc;

View File

@@ -279,7 +279,7 @@ function Article({resource}: { resource: ResourceDetails }) {
}) })
html = splits.join(" ") html = splits.join(" ")
return <div return <div
className={`w-full max-w-xl rounded-xl overflow-clip ${html.includes("youtube") ? "aspect-video" : "h-48 sm:h-64"}`} className={`w-full my-3 max-w-xl rounded-xl overflow-clip ${html.includes("youtube") ? "aspect-video" : "h-48 sm:h-64"}`}
dangerouslySetInnerHTML={{ dangerouslySetInnerHTML={{
__html: html __html: html
}}></div> }}></div>