Skip to content

Commit 8595508

Browse files
committed
fix(docs): stop the preview card clipping component popups
The card's overflow-hidden sliced every dropdown off at the card's own edge, hiding most of the language menu in the demos. The stage and the embedded code panel now round their own bottom corners instead, so popups can overflow the card the way they would in a real app.
1 parent dc5d9f1 commit 8595508

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

‎src/components/docs/code-panel.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ export function CodePanel({
8989
"not-prose bg-[#FAFAFA] dark:bg-[#0A0A0A]",
9090
standalone
9191
? "mt-3 overflow-hidden rounded-2xl border border-black/10 dark:border-white/10"
92-
: "border-t border-black/10 dark:border-white/10",
92+
: // Embedded in a PreviewShell card, which stopped clipping with
93+
// `overflow-hidden` — the panel rounds its own bottom corners.
94+
"rounded-b-2xl border-t border-black/10 dark:border-white/10",
9395
className,
9496
)}
9597
>

‎src/components/docs/preview-shell.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function PreviewShell({ code, highlighted, fullBleed, children }: Preview
2020
const [previewDark, setPreviewDark] = useState(true);
2121

2222
return (
23-
<div className="not-prose mt-3 overflow-hidden rounded-2xl border border-black/10 bg-black/[0.02] dark:border-white/10 dark:bg-white/[0.02]">
23+
<div className="not-prose mt-3 rounded-2xl border border-black/10 bg-black/[0.02] dark:border-white/10 dark:bg-white/[0.02]">
2424
<div className="flex items-center justify-between gap-3 px-3 py-2">
2525
<div className="flex items-center gap-0.5 rounded-lg bg-black/5 p-0.5 dark:bg-white/5">
2626
{(["preview", "code"] as const).map((v) => (
@@ -57,6 +57,9 @@ export function PreviewShell({ code, highlighted, fullBleed, children }: Preview
5757
<div
5858
className={cn(
5959
"relative overflow-visible border-t border-black/10 transition-colors dark:border-white/10",
60+
// Rounds the card's bottom corners by itself now that the card no
61+
// longer clips with `overflow-hidden` — dropdowns may overflow it.
62+
"rounded-b-2xl",
6063
// `light` is what turns the stage back off inside the dark site shell —
6164
// the absence of `dark` is not enough, see the `@variant` in globals.css.
6265
previewDark ? "dark" : "light",

0 commit comments

Comments
 (0)