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

DDFHER-96 - Add @media print to enable printing of articles in modals #744

Merged
merged 2 commits into from
Oct 22, 2024

Conversation

kasperbirch1
Copy link
Contributor

@kasperbirch1 kasperbirch1 commented Oct 15, 2024

Link to issue

https://reload.atlassian.net/browse/DDFHER-96

Description

This pull request adds @media print CSS styles to our modal component to enable proper printing of articles displayed within modals. While this solution addresses the immediate issue, we might want to consider using a library like react-to-print for a more beautiful approach in the future.

Screenshot of the result

print.pdf

Test

https://varnish.pr-1657.dpl-cms.dplplat01.dpl.reload.dk/work/work-of%3A870971-avis%3A89724244?type=artikel&modal=infomedia-modal-870971-avis%3A89724244

Copy link
Contributor

@kasperg kasperg left a comment

Choose a reason for hiding this comment

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

👍

I am not too happy about the result of this change. We went from a print version which only displays the content of the modal but also only displays the first page multiple time to a print version which displays the entire page including both the modal and the underlying content.

We have both tried to address this in multiple ways but without succeeding at a better result. We have decided to proceed with the suggested change for now.

@kasperg kasperg assigned kasperbirch1 and unassigned kasperg, xendk and rasben Oct 22, 2024
@kasperbirch1 kasperbirch1 merged commit 1434326 into develop Oct 22, 2024
8 checks passed
@kasperbirch1 kasperbirch1 deleted the DDFHER-96-print-articles-in-modal branch October 22, 2024 07:28
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.

4 participants