An Obsidian CSS snippet for setting monospace font to JetBrains Mono
UNLICENSE License
jetbrains-mono-font-monospace-theme.css is an Obsidian CSS snippet that sets Obsidian's monospace font to JetBrains Mono.
[!note] The following instructions written for Windows desktop. They are likely similar on other platforms but have not been tested.
To use the CSS snippet:
This CSS snippet is useful when:
A tool such as https://transfonter.org can be used to Base64 encode a font. Base64 encoding the font produces a CSS file where the font data is embedded within a @font-face
definition.
The @font-face
definition in jetbrains-mono-font-monospace-theme.css needs to be replaced with your new definition and the --font-monospace-theme
definition in the body
element needs to be updated:
body {
--font-monospace-theme: 'NEW FONT NAME';
}
Obsidian has a few intrinsic site font CSS variables including --font-monospace-theme
. New definitions for --font-text-theme
and --font-interface-theme
need to be included in the body
element of jetbrains-mono-font-monospace-theme.css:
body {
--font-text-theme: 'JetBrains Mono';
--font-monospace-theme: 'JetBrains Mono';
--font-interface-theme: 'JetBrains Mono';
}
This repo has an Unlicense license as I've only really aggregated data rather than producing something novel.
This repo also includes the JetBrains Mono's OFL.txt which is copied from https://github.com/JetBrains/JetBrainsMono/blob/master/OFL.txt.