Skip to content

Instantly share code, notes, and snippets.

@pmbauer
Last active February 11, 2022 16:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmbauer/42d67769c419ebf799938db62b1671bf to your computer and use it in GitHub Desktop.
Save pmbauer/42d67769c419ebf799938db62b1671bf to your computer and use it in GitHub Desktop.
fixed-width fonts and ligature preservation in edit mode
:root {
--font-monospace: "MonoLisa", "JetBrains Mono", "Consolas", monospace !important;
--font-family-preview-edit-code: "MonoLisa", "JetBrains Mono", "Consolas", monospace !important;
--text-family-inline-code: "MonoLisa", "JetBrains Mono", "Consolas", monospace !important;
--rb-indent-font-family: "MonoLisa", "JetBrains Mono", "Consolas", monospace !important;
}
/**
* Use fixed-width font for edit mode
*/
.cm-s-obsidian,
.cm-s-obsidian .hmd-fold-html kbd,
.cm-header,
span.cm-strong, span.cm-em,
.markdown-preview-view :not(pre) > code,
.markdown-preview-view pre,
.markdown-source-view.mod-cm6 .cm-scroller,
.cm-hmd-list-indent .cm-hmd-list-indent-1,
.markdown-preview-view.is-readable-line-width .markdown-preview-sizer,
.markdown-source-view.is-readable-line-width .CodeMirror,
textarea {
font-family: var(--font-monospace) !important;
/**
* Preserves ligatures regardless of theme (e.g. Blue Topaz).
* Any value other than 'normal' disables ligatures.
*/
letter-spacing: normal !important;
/**
* MonoLisa script italics
*/
font-feature-settings: "ss01" 1, "ss03" 0, "ss05" 1, "ss06" 0, "calt" 1, "ss02" 1, "zero" !important;
}
/**
* Disable small font for header prefixes in Blue Topas
*/
div.CodeMirror-activeline .CodeMirror-line span.cm-formatting.cm-formatting-header,
div:not(.CodeMirror-activeline)>.CodeMirror-line span.cm-formatting.cm-formatting-header {
font-size: 1em;
}
@pmbauer
Copy link
Author

pmbauer commented Feb 11, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment