Skip to content

Commit d73bd22

Browse files
committed
fix: layout issues on mobile view
1 parent fbfd450 commit d73bd22

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

pages/post/[id].tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ export default function Post({ postData, relatedPosts }: InferGetStaticPropsType
9797
<Header isDark={false} />
9898
<div className="max-w-[90rem] mx-auto px-6 py-20 flex gap-16">
9999
{/* Main content */}
100-
<main className="flex-1 max-w-3xl prose prose-xl mr-[17rem]">
100+
<main className="flex-1 prose prose-xl max-w-none">
101101
<h1 className="text-4xl font-bold mb-4">{postData.title}</h1>
102102
<p className="text-gray-500 text-sm mb-8">{postData.date}</p>
103-
<article>
103+
<article className="overflow-x-auto">
104104
<MDXRemote {...postData.mdxSource} components={components}/>
105105
</article>
106106
{relatedPosts.length > 0 && (
@@ -129,7 +129,7 @@ export default function Post({ postData, relatedPosts }: InferGetStaticPropsType
129129

130130
{/* Table of contents */}
131131
<aside
132-
className="hidden lg:block fixed right-10 top-[96px] w-60 h-[calc(100vh-96px)] pl-4 z-40 pb-[120px]"
132+
className="hidden lg:block sticky top-[96px] w-60 h-[calc(100vh-96px)] pl-4 z-40 pb-[120px]"
133133
>
134134
<div className="relative h-full">
135135
{/* Scrollable 목차 영역 */}

styles/globals.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,16 @@ code {
8383
.prose code::after {
8484
content: none;
8585
}
86+
87+
.prose img {
88+
max-width: 100%;
89+
height: auto;
90+
}
91+
.prose pre {
92+
overflow-x: auto;
93+
}
94+
95+
.prose table {
96+
@apply w-full table-auto;
97+
overflow-x: auto;
98+
}

0 commit comments

Comments
 (0)