Skip to content

Commit 263cd6b

Browse files
committed
Committing Theme changes for blog section
1 parent 12671f4 commit 263cd6b

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

src/pages/blogs/[slug].astro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ const {Content} = await blog.render();
3030

3131
<Layout title={blog.data.title}>
3232
<section class="flex justify-center mt-12">
33-
<div id="markdown" class="prose prose-lg overflow-visible relative mb-5">
33+
<div id="markdown" class="prose prose-lg max-w-full px-4 sm:px-0 relative mb-5">
3434
<Content />
3535
</div>
3636
</section>
3737

38+
<!-- markdown overflow styles moved to src/styles/theme.css -->
39+
3840
<script>
3941
import { toggleMarkdownTheme } from "../../scripts/theme";
4042

src/styles/theme.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,19 @@
1616
--color-background: theme("colors.gray.900");
1717
--color-background-offset: theme("colors.gray.800");
1818
--color-border: theme("colors.gray.50" / 10%);
19+
}
20+
21+
/* Prevent horizontal overflow for markdown content (code blocks, tables) */
22+
#markdown pre,
23+
#markdown table,
24+
#markdown code {
25+
max-width: 100%;
26+
overflow-x: auto;
27+
-webkit-overflow-scrolling: touch;
28+
word-break: break-word;
29+
white-space: pre-wrap;
30+
}
31+
#markdown table {
32+
display: block;
33+
width: 100%;
1934
}

0 commit comments

Comments
 (0)