Skip to content

Commit 1e97574

Browse files
CodeDemo: fix horizontal scrollbar by aligning container padding and separator margins to stabilize code block layout across breakpoints.
This reduces content overflow and improves visual consistency across breakpoints. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
1 parent 8c6d496 commit 1e97574

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

web/src/components/docs/mdx/code-demo.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ export function CodeDemo({ children, language, rawContent }: CodeDemoProps) {
8484
}
8585

8686
return (
87-
<div className="rounded-lg border bg-muted/30 w-full max-w-80 md:max-w-full my-3 transition-all group hover:bg-muted/40 overflow-x-auto">
88-
<div className="flex items-center justify-between h-6 mt-0.5 mb-0.5 px-4">
87+
<div className="rounded-lg border bg-muted/30 px-4 w-full max-w-80 md:max-w-full my-3 transition-all group hover:bg-muted/40 overflow-x-auto">
88+
<div className="flex items-center justify-between h-6 mt-0.5 mb-0.5">
8989
<div className="text-[10px] text-muted-foreground/40 font-mono tracking-wide">
9090
{language.toLowerCase()}
9191
</div>
@@ -101,8 +101,8 @@ export function CodeDemo({ children, language, rawContent }: CodeDemoProps) {
101101
)}
102102
</button>
103103
</div>
104-
{language && <Separator className="bg-border/20 mb-0.5 mx-4" />}
105-
<div className="px-4">
104+
{language && <Separator className="bg-border/20 mb-0.5" />}
105+
<div>
106106
<pre className="text-[13px] leading-relaxed py-1 bg-transparent text-foreground/90 rounded-lg scrollbar-thin scrollbar-thumb-muted-foreground/10 scrollbar-track-transparent">
107107
<code className="font-mono">{childrenContent}</code>
108108
</pre>

0 commit comments

Comments
 (0)