File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed
packages/gitbook/src/components Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " gitbook " : patch
3
+ ---
4
+
5
+ Fix PDF generation when user has dark mode configured.
Original file line number Diff line number Diff line change @@ -12,14 +12,15 @@ export function Tabs(props: BlockProps<DocumentBlockTabs>) {
12
12
const tabs : TabsItem [ ] = [ ] ;
13
13
const tabsBody : React . ReactNode [ ] = [ ] ;
14
14
15
- block . nodes . forEach ( ( tab ) => {
15
+ block . nodes . forEach ( ( tab , index ) => {
16
16
tabs . push ( {
17
17
id : tab . meta ?. id ?? tab . key ! ,
18
18
title : tab . data . title ?? '' ,
19
19
} ) ;
20
20
21
21
tabsBody . push (
22
22
< Blocks
23
+ key = { tab . key ?? index }
23
24
nodes = { tab . nodes }
24
25
document = { document }
25
26
ancestorBlocks = { [ ...ancestorBlocks , block , tab ] }
Original file line number Diff line number Diff line change 1
1
import { CustomizationRootLayout } from '@/components/RootLayout' ;
2
2
import { defaultCustomization } from '@/lib/utils' ;
3
+ import { CustomizationThemeMode } from '@gitbook/api' ;
3
4
import type { GitBookSiteContext , GitBookSpaceContext } from '@v2/lib/context' ;
4
5
5
6
/**
@@ -16,6 +17,7 @@ export async function PDFRootLayout(props: {
16
17
customization = {
17
18
'customization' in context ? context . customization : defaultCustomization ( )
18
19
}
20
+ forcedTheme = { CustomizationThemeMode . Light }
19
21
>
20
22
{ children }
21
23
</ CustomizationRootLayout >
You can’t perform that action at this time.
0 commit comments