Skip to content

Commit d024658

Browse files
authored
Prevent page breaks inside blocks when printing (#3507)
1 parent 6b9f6b5 commit d024658

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/purple-poems-melt.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'gitbook': patch
3+
---
4+
5+
Prevent page breaks inside blocks when printing

packages/gitbook/src/components/DocumentView/Blocks.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export function UnwrappedBlocks<TBlock extends DocumentBlock>(props: UnwrappedBl
8585
key={node.key || `${node.type}-${index}`}
8686
block={node}
8787
style={[
88-
'mx-auto page-width-wide:mx-0 w-full decoration-primary/6',
88+
'mx-auto page-width-wide:mx-0 w-full decoration-primary/6 print:break-inside-avoid',
8989
node.data && 'fullWidth' in node.data && node.data.fullWidth
9090
? 'max-w-screen-2xl'
9191
: 'max-w-3xl',

0 commit comments

Comments
 (0)