Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image distributed on two pages with Firefox #27

Open
fkohrt opened this issue Aug 22, 2020 · 2 comments
Open

Image distributed on two pages with Firefox #27

fkohrt opened this issue Aug 22, 2020 · 2 comments

Comments

@fkohrt
Copy link

fkohrt commented Aug 22, 2020

Firefox 79 may distribute images on two pages (screenshot from print preview of oldstyle.html):

Firefox distributes image over two pages; screenshot from print preview

Is this something that can be remedied by the Gutenberg framework?

@BafS
Copy link
Owner

BafS commented Sep 6, 2020

Thanks for the feedback, indeed it seems to be an issue with Firefox (see https://bugzilla.mozilla.org/show_bug.cgi?id=1109275).

One workaround is to use the new avoid-break-inside utility to wrap the image

<div class="avoid-break-inside">
    <img src="gutenberg.png" />
</div>

or to simply add display: inline-block to images.

I may change the behavior in a next release but I'm not exactly sure what is the right behavior in this case and how browsers will implement it. See https://drafts.csswg.org/css-break/#propdef-break-inside.

@fkohrt
Copy link
Author

fkohrt commented Jan 23, 2021

I've recently been using paged.js to create printable documents (using Hugo and the pagedjs-hugo theme component) and had no issues with images being split across pages. Maybe their implementation can provide some insight...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants