When using cssclass in the yaml frontmatter of a note, to facilitate custom styling for that note, the custom css is applied to the note/page, but is ignored in the PDF export.
For example:
YAML:
---
cssclass: h1_red
---
CSS:
.h1_red.markdown-preview-view h1{
color: red!important
}
@media print {
.h1_red.markdown-preview-view h1{
color: red!important
}
}
Note in Obsidian:
PDF Export: