Paragraph spacing in edit AND read mode?

I have a very simple css snippet which gets me some spacing in between pararaphs (I don’t want to hit Enter twice):

.markdown-source-view.mod-cm6 .cm-line {
padding-bottom: 10px;
}

This works great, but when I switch to reading mode or try to export to PDF for printing, the spacing is lost. How can I get the same effect in read mode & PDFs?

I’m using the Things theme, but I’m not wedded to it if that helps.

Things I have tried

I’ve searched the forum and found nothing that quite does this. I got to the developer console and tried to follow it through, and figured out that editing and reading are done differently (br instead of cm-line?) but I’m not good at CSS. I’ve played with various things like

.markdown-preview-view br {
padding-bottom: 10px;
}

and similar things but nothing has worked. Please can someone help?

i made a mistake above and only now got near a pc…sorry…

try:

.markdown-preview-view p {
  padding-bottom: 10px;
}

or if anybody needs to override some theme settings:

.markdown-preview-view p {
  padding-bottom: 10px !important;
}

you can go into developer console (CTRL+SHIFT+I) and hunt for what you need… (> elements > inspect)

in this case:

Thanks for your reply. Unfortunately it doesn’t work, even with !important. I think it’s because in ‘read’ mode, it’s rendered with ‘br’ not ‘p’.

This is what it looks like in ‘edit’ mode:

This is what it looks like in ‘read’ mode:

This is what the developer console shows me for the above, in ‘read’ mode:

Is there any way to get the CSS to add the padding on a ‘br’ rather than a ‘p’? Or is there a way to get Obsidian to render the 'br’s as ‘p’?

Literally just change the p to a br.

.markdown-preview-view br {
  padding-bottom: 10px !important;
}

Hmmm, this just isn’t working for me. Is there any chance you could try it on your system, in case it’s something I’m doing wrong?

OK so this is where I’m at with this. The above suggestions do not work, I think because the whole thing about HTML is that it removes white space. In addition, after further reading, I have decided to embrace the Obsidian thinking that it’s not correct to be wanting Obsidian to be a WYSIWYG editor; the raw files should look correct in any markdown editor and be readable text files, which they would not be if I was able to fiddle with the paragraph spacing in the way that I want. So henceforth I will obediently press ‘Enter’ twice when I want a new paragraph, and live with the way it looks in Edit mode :grin:

For read mode and exporting to PDF, I have installed the Minimal theme and its associated community plugins, and with these I can specify the paragraph spacing for read mode & PDF. This means I can get nicer looking PDFs.

sorry…i cannot look further into this…
would you consider trying a different theme and trying my snippet again…?

i use ultra lobster theme btw

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.