chore(core): use flexbox to stretch editor height (#9174)

This commit is contained in:
CatsJuice 2024-12-16 09:49:12 +00:00
parent 5cc40114fc
commit e6bf4ca6e5
No known key found for this signature in database
GPG Key ID: 1C1E76924FAFDDE4
2 changed files with 11 additions and 4 deletions

View File

@ -281,7 +281,7 @@ export const BlocksuiteDocEditor = forwardRef<
return (
<>
<div className={styles.affineDocViewport} style={{ height: '100%' }}>
<div className={styles.affineDocViewport}>
{!isJournal ? (
<adapted.DocTitle doc={page} ref={onTitleRef} />
) : (
@ -351,9 +351,9 @@ export const BlocksuiteEdgelessEditor = forwardRef<
}, []);
return (
<>
<div className={styles.affineEdgelessDocViewport}>
<adapted.EdgelessEditor ref={onDocRef} doc={page} specs={specs} />
{portals}
</>
</div>
);
});

View File

@ -2,15 +2,22 @@ import { cssVar } from '@toeverything/theme';
import { style, type StyleRule } from '@vanilla-extract/css';
export const docEditorRoot = style({
display: 'block',
overflowX: 'clip',
display: 'flex',
flexDirection: 'column',
});
export const affineDocViewport = style({
height: '100%',
flex: 1,
display: 'flex',
flexDirection: 'column',
paddingBottom: '100px',
});
export const affineEdgelessDocViewport = style({
height: '100%',
flex: 1,
});
export const docContainer = style({
display: 'block',