refactor: Better handling of print CSS styles #3774
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Prompted by the work by @jamdelion to add a print button.
I prototyped a few different approaches here (force background colours to remain, council name as pseudo content in place of logo), but have arrived at a solution that beats all others.
A previous print CSS update removed the large areas of solid header/footer background colour on print (particularly the black of the footer which could take up almost a whole page), and placed a small container with background colour behind the logos. As noted by @jessicamcinchak, removing background colours in print options rendered these invisible (white logo was still in place on white background).
Using
filter: invert(1)
on the images ensure they are still visible regardless of print settings for background graphics, and allows us to keep background colours out of the header + footer.Open the print dialogue to see changes:
Example with SVG council logo:
https://3774.planx.pizza/buckinghamshire/report-a-high-hedge/preview
Example with PNG council logo:
https://3774.planx.pizza/birmingham/find-out-if-you-need-planning-permission/preview