Closed niclan closed 3 years ago
@Skagevang - as long as you're busy patching?
Don’t think this work for window.print() since we are trying to style code tags
Oh yes it works in the browser and in the pre-generated pdfs and it's needed to get our 4th graders to follow the lessons.
Try the ?pdf and then set preview to "print" in the lessons I've mentioned in various tickets.
It's also easy to test since yarn will rebuild as needed at once when the patch applies.
....but, when printing via browser you have to enable background graphics in the print dialog. Which is another reason why browser generated pdf is a bad idea.
I will try later. Thank you for the PR :)
@niclan Yes, this works :D But we need to set !important on other places too, to get all the styling. Or do you just need the blocks? In that case you just need !important on line 242 to get white text in the blocks. I think we should have equal styling on the PDFs as the website. So a lot of !important needs to be added.
Regarding window.print(), I think we should aim to get back to puppeteer, but we should not do that before the line break bug is fixed.
You might be right about e.g. the white text being black on print, but for the kids the background color is the most significant to aid recognizing the text as bricks in scratch. No background - very low recognition.
Also, if the user does not click to get "background graphics" printed on their browser the text would be white on white which would be even worse than just not having the background. Not sure if there is a CSS element we can set to default background printing to on?
For scratch IMHO this PR is sufficient.
Re. puppeteer: chrome page breaks much worse than it. Please bring it back.
I will have a check on https://developer.mozilla.org/en-US/docs/Web/CSS/color-adjust when I got time. Can you post some examples of bad line breaks with save to pdf in browser? Seems to work great for me
This is interesting. When I print directly from the html it breaks pretty well. When I change the query to ...?pdf
and print that it's worse.
Se #688 - here is a PR to fix that.