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
2 changed files with 11 additions and 4 deletions

View File

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

View File

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