diff --git a/.changeset/hint-wide-content-overflow.md b/.changeset/hint-wide-content-overflow.md new file mode 100644 index 000000000..73f1956a7 --- /dev/null +++ b/.changeset/hint-wide-content-overflow.md @@ -0,0 +1,5 @@ +--- +"gitbook": patch +--- + +Fix wide content (such as code blocks and tables) overflowing the edges of hint blocks instead of scrolling within them. diff --git a/packages/gitbook/src/components/DocumentView/Hint.tsx b/packages/gitbook/src/components/DocumentView/Hint.tsx index 28d67b5c2..38f9052b5 100644 --- a/packages/gitbook/src/components/DocumentView/Hint.tsx +++ b/packages/gitbook/src/components/DocumentView/Hint.tsx @@ -92,6 +92,11 @@ export async function Hint({ 'empty:p-0', '-row-end-1', '-col-end-1', + // Allow the grid track to shrink below its content's min-content size so wide + // nested blocks (e.g. code blocks, tables) scroll internally instead of + // overflowing the hint. Without this, the `1fr` column keeps its default + // `min-width: auto` and grows past the hint's width. + 'min-w-0', 'space-y-3', '[&_.hint]:border', '[&_pre]:border',