From 6fbdbc1583c1b3e4d77e270af4f20d4c17dc3da1 Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Wed, 29 Jul 2026 11:31:54 -0400 Subject: [PATCH] Update styling, again Fix font drift fully, remove code block padding, use colorful headings --- appearance.json | 3 +- plugins/obsidian-minimal-settings/data.json | 2 +- snippets/code-blocks.css | 15 +++++++ snippets/text-normalize.css | 44 +++++++++++++++++++++ 4 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 snippets/code-blocks.css diff --git a/appearance.json b/appearance.json index 7559027..cceea70 100644 --- a/appearance.json +++ b/appearance.json @@ -8,7 +8,8 @@ "enabledCssSnippets": [ "font", "vim-cursor", - "text-normalize" + "text-normalize", + "code-blocks" ], "accentColor": "" } \ No newline at end of file diff --git a/plugins/obsidian-minimal-settings/data.json b/plugins/obsidian-minimal-settings/data.json index a936777..5e169a9 100644 --- a/plugins/obsidian-minimal-settings/data.json +++ b/plugins/obsidian-minimal-settings/data.json @@ -16,7 +16,7 @@ "iframeWidth": "iframe-default-width", "mapWidth": "map-default-width", "chartWidth": "chart-default-width", - "colorfulHeadings": false, + "colorfulHeadings": true, "colorfulFrame": false, "colorfulActiveStates": false, "trimNames": true, diff --git a/snippets/code-blocks.css b/snippets/code-blocks.css new file mode 100644 index 0000000..fceb09a --- /dev/null +++ b/snippets/code-blocks.css @@ -0,0 +1,15 @@ +/* Reading view */ +.markdown-rendered pre { + padding-left: 0; + padding-right: 0; +} +.markdown-rendered pre > code { + padding-left: 0; + padding-right: 0; +} + +/* Live Preview */ +.markdown-source-view.mod-cm6 .HyperMD-codeblock { + padding-left: 0 !important; + padding-right: 0 !important; +} diff --git a/snippets/text-normalize.css b/snippets/text-normalize.css index b856081..ed9acdb 100644 --- a/snippets/text-normalize.css +++ b/snippets/text-normalize.css @@ -14,3 +14,47 @@ body { --h6-weight: 600; --h6-variant: normal; } + +/* ---------- 1. one face everywhere ---------- */ +body { + --my-mono: "iA Writer Mono V", "JetBrains Mono", "Berkeley Mono", var(--font-monospace-default); + + /* Minimal's theme-level vars, skip the interface */ + --font-text-theme: var(--my-mono); + --font-monospace-theme: var(--my-mono); + + /* Obsidian core vars */ + --font-text: var(--my-mono); + --font-monospace: var(--my-mono); + + --h1-font: var(--my-mono); + --h2-font: var(--my-mono); + --h3-font: var(--my-mono); + --h4-font: var(--my-mono); + --h5-font: var(--my-mono); + --h6-font: var(--my-mono); + + /* put code on the same grid as body text */ + --code-size: var(--font-text-size); +} + +/* ---------- 2. kill what breaks the grid ---------- */ +.markdown-rendered :is(h1, h2, h3, h4, h5, h6), +.inline-title, +.cm-s-obsidian .HyperMD-header, +.cm-s-obsidian :is(.cm-header-1, .cm-header-2, .cm-header-3, + .cm-header-4, .cm-header-5, .cm-header-6), +.callout-title-inner, +.table-view-table, +code, pre, .cm-line, .metadata-property-value { + font-family: var(--my-mono) !important; + letter-spacing: 0 !important; + word-spacing: 0 !important; + font-variant: normal !important; + font-kerning: none; + font-variant-ligatures: none; + font-feature-settings: "liga" 0, "clig" 0, "calt" 0, "kern" 0; + font-synthesis: none; + text-rendering: optimizeSpeed; +} +