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

WebPDFExporter: Emulate media print #1791

Merged
merged 1 commit into from
Jun 13, 2022

Conversation

martinRenou
Copy link
Member

@martinRenou martinRenou commented Jun 9, 2022

This PR reverts a change I made in #1718 where I wrongly thought that we needed to emulate the "screen" media in order for the background to properly be colored when using a custom theme, but it does not seem to be the case, only the "printBackground" pyppeteer option and the "webkit-print-color-adjust" CSS rules are needed.

The "print" media emulation is needed so that the following CSS rules are properly applied (fixing issues with page breaks on the PDF output): https://github.com/jupyter/nbconvert/blob/main/share/templates/lab/index.html.j2#L117

cc. @mnowacki-b

Copy link
Contributor

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@blink1073 blink1073 merged commit c3bc92e into jupyter:main Jun 13, 2022
@martinRenou martinRenou deleted the emulate_print_webpdf branch June 13, 2022 15:17
@martinRenou
Copy link
Member Author

martinRenou commented Jun 13, 2022

Thank you for merging!

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

Successfully merging this pull request may close these issues.

2 participants