I made some Mermaid templates for my team, and noticed many of them spilled off the page when included in a PDF export, so this CSS helps them print nicely, never overflowing more than one page. This make very large charts very small, but I figure if you need that much control over large format printing, Export to PDF from Markdown may not be the answer.
Not entirely sure I’ve done this correctly- adding the “> svg” was the only way I could get a visible result, but that may have side effects I have not seen.
Personally I’ve also got this as another CSS snippet, so that the same downscaling happens in preview mode:
@Jadael: thanks for this, it is a sine qua non for PDF export.
Unfortunately, it does not work for me, so I may have done something wrong.
I created a snippet with your code (the top block), then enabled the snippet, and assumed that doing a PDF export the Mermaid graph would scale to the page width.
Also, in the PDF export window, there is a %-age slider which I set to 100.
and I found that in scale 100% it will be cut on the right sight. I want only to scale this. Not the whole text in the document. Any idea how to control this?