Skip to content
Discussion options

You must be logged in to vote

Reposting Joe's slack message here:

For anyone working on paginated Slate editors, Tiptap's PageKit extension uses a very clever CSS trick to visually position page breaks in the middle of the content, splitting paragraphs automatically, without needing to do any manual splitting in the DOM.
It works using two floating DIV elements. The first DIV has a width of zero and serves only to push the second DIV down to the correct position. The second DIV is the page break, and it uses the clear CSS rule to position itself immediately below the first DIV.
Here's a minimal demonstration of the concept behind it. See the HTML and CSS comments for a full explanation. https://codepen.io/12joan/full…

Replies: 6 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@zbeyens
Comment options

@iamjaehaklee
Comment options

@zbeyens
Comment options

@tekkokw
Comment options

@zbeyens
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by zbeyens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants