From 72c485e0c88375a09dbf119a92d13ebd404aebea Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Thu, 23 Nov 2023 09:50:58 -0500 Subject: [PATCH] fix: HTML exports have extra empty page, closes #6205 --- server/models/helpers/ProsemirrorHelper.tsx | 2 +- shared/editor/components/Styles.ts | 11 ----------- shared/styles/globals.ts | 5 +++-- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/server/models/helpers/ProsemirrorHelper.tsx b/server/models/helpers/ProsemirrorHelper.tsx index ace7cc5ab..57437d102 100644 --- a/server/models/helpers/ProsemirrorHelper.tsx +++ b/server/models/helpers/ProsemirrorHelper.tsx @@ -183,7 +183,7 @@ export default class ProsemirrorHelper {
{children}
) : ( <> - + {children} )} diff --git a/shared/editor/components/Styles.ts b/shared/editor/components/Styles.ts index 4ec253b83..b8410e53d 100644 --- a/shared/editor/components/Styles.ts +++ b/shared/editor/components/Styles.ts @@ -261,16 +261,6 @@ const emailStyle = (props: Props) => css` } `; -const printStyle = (props: Props) => css` - ${props.staticHTML && - ` - body { - height: auto; - min-height: 0; - } - `} -`; - const style = (props: Props) => ` flex-grow: ${props.grow ? 1 : 0}; justify-content: start; @@ -1570,7 +1560,6 @@ const EditorContainer = styled.div` ${codeBlockStyle} ${findAndReplaceStyle} ${emailStyle} - ${printStyle} `; export default EditorContainer; diff --git a/shared/styles/globals.ts b/shared/styles/globals.ts index c79bdb334..a1c919b17 100644 --- a/shared/styles/globals.ts +++ b/shared/styles/globals.ts @@ -3,6 +3,7 @@ import styledNormalize from "styled-normalize"; import { breakpoints, depths, s } from "."; type Props = { + staticHTML?: boolean; useCursorPointer?: boolean; }; @@ -16,7 +17,7 @@ export default createGlobalStyle` html, body { width: 100%; - height: 100%; + height: ${(props) => (props.staticHTML ? "0" : "100%")}; margin: 0; padding: 0; print-color-adjust: exact; @@ -46,7 +47,7 @@ export default createGlobalStyle` @media (min-width: ${breakpoints.tablet}px) { html, body { - min-height: 100vh; + min-height: ${(props) => (props.staticHTML ? "0" : "100vh")}; } }