Skip to content

Commit bb1bdce

Browse files
fix: PDF block example styling (#785)
* Fixed PDF block example styling * Fixed CSS scoping
1 parent 8784d15 commit bb1bdce

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

examples/05-custom-schema/04-pdf-file-block/PDF.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ import {
66
FileAndCaptionWrapper,
77
ReactCustomBlockRenderProps,
88
} from "@blocknote/react";
9-
109
import { RiFilePdfFill } from "react-icons/ri";
1110

11+
import "./styles.css";
12+
1213
export const PDFPreview = (
1314
props: Omit<
1415
ReactCustomBlockRenderProps<FileBlockConfig, any, any>,
@@ -21,8 +22,6 @@ export const PDFPreview = (
2122
src={props.block.props.url}
2223
contentEditable={false}
2324
draggable={false}
24-
height={props.editor.domElement.clientWidth * 1.5}
25-
width={props.editor.domElement.clientWidth}
2625
onClick={() => props.editor.setTextCursorPosition(props.block)}
2726
/>
2827
);
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[data-content-type="pdf"] .bn-file-block-content-wrapper,
2+
[data-content-type="pdf"] .bn-file-and-caption-wrapper {
3+
height: 800px;
4+
width: 100%;
5+
}
6+
7+
[data-content-type="pdf"] embed {
8+
height: 100%;
9+
width: 100%;
10+
}

0 commit comments

Comments
 (0)