diff --git a/appearance.json b/appearance.json index 263c859..f42749d 100644 --- a/appearance.json +++ b/appearance.json @@ -10,7 +10,8 @@ "vim-cursor", "text-normalize", "code-blocks", - "minimal-heading-colors" + "minimal-heading-colors", + "minimal-mono-grid" ], "accentColor": "" } \ No newline at end of file diff --git a/snippets/minimal-heading-colors.css b/snippets/minimal-heading-colors.css deleted file mode 100644 index f7c5fb5..0000000 --- a/snippets/minimal-heading-colors.css +++ /dev/null @@ -1,8 +0,0 @@ -body.colorful-headings { - --h1-color: var(--color-purple); - --h2-color: var(--color-purple); - --h3-color: var(--color-purple); - --h4-color: var(--color-purple); - --h5-color: var(--color-purple); - --h6-color: var(--color-purple); -} diff --git a/snippets/minimal-mono-grid.css b/snippets/minimal-mono-grid.css new file mode 100644 index 0000000..28da04f --- /dev/null +++ b/snippets/minimal-mono-grid.css @@ -0,0 +1,93 @@ +/* ============================================================ + Minimal — monospace grid + Save to .obsidian/snippets/ and enable in + Settings → Appearance → CSS snippets + ============================================================ */ + +/* ---- 1. Font + size variables ------------------------------ */ +body { + --my-mono: "iA Writer Mono V", "JetBrains Mono", "Berkeley Mono", var(--font-monospace-default); + + --font-text-theme: var(--my-mono); + --font-monospace-theme: var(--my-mono); + --font-text: var(--my-mono); + --font-monospace: var(--my-mono); + + --code-size: var(--font-text-size); + + --h1-size: 18px; --h1-weight: 600; + --h2-size: 18px; --h2-weight: 600; + --h3-size: 18px; --h3-weight: 600; + --h4-size: 18px; --h4-weight: 600; + --h5-size: 18px; --h5-weight: 600; + --h6-size: 18px; --h6-weight: 600; + + --h1-variant: normal; --h2-variant: normal; --h3-variant: normal; + --h4-variant: normal; --h5-variant: normal; --h6-variant: normal; + + --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); +} + +/* ---- 2. Heading colors ------------------------------------- + Must be body.colorful-headings (0,1,1) to beat Minimal's own + rule. Delete this block if colorful headings is off. */ +body.colorful-headings { + --h1-color: var(--color-purple); + --h2-color: var(--color-purple); + --h3-color: var(--color-purple); + --h4-color: var(--color-purple); + --h5-color: var(--color-purple); + --h6-color: var(--color-purple); +} + +/* ---- 3. Catch-all: family + metrics, NEVER size ------------- */ +.markdown-source-view.mod-cm6 .cm-line, +.markdown-source-view.mod-cm6 .cm-line *, +.markdown-rendered, +.markdown-rendered * { + font-family: var(--my-mono) !important; + letter-spacing: 0 !important; + word-spacing: 0 !important; + font-variant: normal !important; + font-kerning: none !important; + font-variant-ligatures: none !important; + font-feature-settings: "liga" 0, "clig" 0, "calt" 0, "kern" 0 !important; + font-synthesis: none !important; + text-rendering: optimizeSpeed; +} + +/* ---- 4. Footnotes: force size back to the grid ------------- + Scoped so it can't touch headings. This is the piece the + catch-all could not do. */ +.cm-s-obsidian .cm-line.HyperMD-footnote, +.cm-s-obsidian .cm-line.HyperMD-footnote *, +.cm-s-obsidian span.cm-footref, +.cm-s-obsidian span.cm-footref.cm-hmd-barelink, +.cm-s-obsidian span.cm-footref.cm-hmd-barelink.cm-formatting, +.markdown-rendered .footnotes, +.markdown-rendered .footnotes *, +.markdown-rendered sup, +.markdown-rendered sub, +.markdown-rendered a.footnote-link { + font-size: var(--font-text-size) !important; + line-height: var(--line-height-normal) !important; + vertical-align: baseline !important; +} + +.markdown-rendered .footnotes ol > li::marker { + font-family: var(--my-mono); + font-size: var(--font-text-size); +} + +/* ---- 5. Code blocks flush with body text ------------------- */ +.markdown-rendered pre, +.markdown-rendered pre > code { + padding-left: 0; + padding-right: 0; +} +.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 ed9acdb..1ff22a5 100644 --- a/snippets/text-normalize.css +++ b/snippets/text-normalize.css @@ -58,3 +58,54 @@ code, pre, .cm-line, .metadata-property-value { text-rendering: optimizeSpeed; } +/* Footnotes */ + +/* Reference marker, both views */ +a.footnote-link, +.cm-s-obsidian span.cm-footref.cm-hmd-barelink, +.cm-s-obsidian span.cm-footref.cm-hmd-barelink.cm-formatting { + font-family: var(--my-mono) !important; + font-size: inherit !important; + letter-spacing: 0 !important; +} + +/* The wrapper does the raising, not the */ +.markdown-rendered sup { + vertical-align: baseline !important; + font-size: inherit !important; + line-height: inherit !important; +} + +/* Footnote text, both views */ +.footnotes, +.footnotes p, +.footnotes li, +.cm-s-obsidian .cm-line.HyperMD-footnote { + font-family: var(--my-mono) !important; + font-size: var(--font-text-size) !important; + line-height: var(--line-height-normal); + letter-spacing: 0 !important; +} + +/* List numbers -- ::marker accepts font properties */ +.footnotes ol > li::marker { + font-family: var(--my-mono); + font-size: var(--font-text-size); +} + + +/* catch-all: normalize every descendant span, + without touching size (which would flatten headings) */ +.markdown-source-view.mod-cm6 .cm-line, +.markdown-source-view.mod-cm6 .cm-line *, +.markdown-rendered, +.markdown-rendered * { + font-family: var(--my-mono) !important; + letter-spacing: 0 !important; + word-spacing: 0 !important; + font-kerning: none !important; + font-variant-ligatures: none !important; + font-feature-settings: "liga" 0, "clig" 0, "calt" 0, "kern" 0 !important; + font-synthesis: none !important; +} +