Make monospace as default font

What I’m trying to do

I’ve been trying to make monospace the default for editor mode, found an old thread that explains how to do so using CSS snippets. Tried it but only works on minimal theme. Wanted to see if I can make it work for the other themes as minimal is my least favorite.

Things I have tried

Monospace Font in the Editor - Help - Obsidian Forum

If you say what theme you are using it might be easier for folks to help - a lot of snippets work fine with some themes, but don’t do anything in others depending on how the theme is set up. You could give this a try for editing modes (Source and Live Preview):

/* source mode font */
.markdown-source-view.mod-cm6:not(.is-live-preview) .cm-scroller {
  font-family: 'Baoli SC'; }
/* live preview mode font */
.markdown-source-view.mod-cm6:is(.is-live-preview) .cm-scroller {
  font-family: 'Comic Sans MS'; }
1 Like

I’m using Atom.

It also seems to be that whenever I don’t type a font name, I get a specific font that is monospace. However, when I use any font in specific it turns to said font but stops being monospace.

This is with the font name

This is without the font name

Sorry if I wasn’t clear. The above CSS was an example. You should replace the font-family name with the specific monospace font you want to use here.

It’s no problem, got what you meant. Thing is when I put in any font, it stops being monospace and characters start having different widths, as seen in the picture above. Any idea why that’s the case? Or am I just confused with what monospace is?

Can this be done with Settings > Appearance > Text Font or is there an incompatibility with the theme?

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