A CSS class/id for note title when exporting as PDF with preview theme


(Rino) #1

Question

It seems note title uses h1 definition of preview CSS when exporting as PDF.
However, h1 is used for # (h1 block of markdown), so that both the note title and # block shares the same style.
I would like to make looks differently for note title and h1 in body.
Could you tell me the CSS class/id for note title?
I exported as HTML but could not figure out specific class/id for it.

Info

  • Platform: macOS
  • Platform version: Catalina (sorry if this is specific issue for beta OS)
  • App Version: 4.3.2

(Takuya Matsuyama) #2

Hi Rino-san,

Thank you for the question.
h1 for note title always appears as the first child of div inside body.mde-preview.
To tweak style of the note title, add the following to the custom CSS like so:

body.mde-preview > div:first-child > h1:first-child {
  color: red;
}

Hope that helps!


(Rino) #3

Thank you very much! It works!
Actually I use .less so I added following selector inside .mde-preview just after the definition of h1:

& > div:first-child > h1:first-child

(Takuya Matsuyama) #4

Great!