DEV Community

Cosimo Streppone
Cosimo Streppone

Posted on • Originally published at streppone.it on

TIL: Styling Obsidian text paragraphs

TIL that it’s possible to style Obsidian text paragraphs in a way that allows me to focus on the actual text content and not on the fact that I need to add an artificial line break every time I type a paragraph :-)

Obsidian can use CSS snippets to style the application itself and the text/markdown content. The CSS snippets need to be saved in <vault_directory>/snippets/whatever.css.

This is how to get that “natural” book-like spacing between paragraphs, and avoid adding spurious line breaks in the markdown code:

.cm-contentContainer {
  line-height: 1.70rem;
}

.markdown-source-view.mod-cm6 .cm-content > .cm-line {  
  padding-bottom: 12px !important;  
}
Enter fullscreen mode Exit fullscreen mode

Of course, the values for main line-height and padding will depend on your particular screen and font settings. In my case I use a screen tilted in vertical position for writing and coding, and my font of choice is the beautiful Berkeley Graphics’s Berkeley Mono.

Top comments (0)