Hi @WhiteNoise, thanks for writing back!
Thanks for the tip regarding @media print {}
. That works well to specify css that only affects PDF output.
However, that doesn’t solve the problem I’m seeing.
The issue is that export to PDF seems to be ignoring the cssclass:
directive in the frontmatter. I can get regular css to appear in the PDF, e.g. h1 { color:green; }
, but if I add a page-level class to the frontmatter using cssclass:
it does not appear in the PDF.
I’ve attached a mini-vault that demonstrates the issue. To see it, unzip the vault and load it in Obsidian, and see that “Regular Page” has black headers and “Special Page” has green headers using the cssclass
directive. Then export “Special Page” to PDF and observe that the PDF headers are black, not green.
cssclass.zip (2.2 KB)