Aether Markey25 downloadsUnify body line height, source line break spacing, and heading sizes and spacing across reading view, Live Preview, and source mode.
English | 简体中文
Unified typography controls for Obsidian. One set of settings drives both editing mode (Live Preview + source mode) and reading mode, so your notes look the same wherever you read or edit them.
No build step required — main.js is plain JavaScript.
Version 2.0.0 is a complete rebuild of the plugin:
px or em — switch units on any slider
at any time.--hN-size / --hN-weight variables so themes stay in sync.--list-spacing).--list-indent) and
optional line height inside items.--table-line-height).$$…$$) — space above/below (both modes).![[note]]) — space above/below.px or em — your choice, per setting.The plugin reads its settings and generates one CSS stylesheet that is
injected into the app. Wherever Obsidian already exposes typography CSS
variables (--line-height-normal, --p-spacing, --list-spacing,
--list-indent, --hN-size, --hN-weight, --table-line-height, …) the
plugin sets those variables, which keeps editing mode, reading mode, rendered
embeds, hover popovers and canvas cards consistent and theme-friendly. Where
no variable exists it emits targeted rules for .markdown-rendered (reading)
and .markdown-source-view.mod-cm6 / HyperMD-* line classes (editing).
Editing-mode spacing is applied through line padding on CodeMirror lines
(HyperMD-header-N, HyperMD-codeblock-begin/end, HyperMD-hr, …) and
through the height of blank lines, using the same :has(> br:only-child)
blank-line detection that Obsidian itself uses.
main.js, styles.css and manifest.json from the
latest release.<vault>/.obsidian/plugins/unified-typography/.Copy manifest.json, main.js and styles.css from this repository into
<vault>/.obsidian/plugins/unified-typography/ — no build step is needed.
Configure everything under Settings → Unified Typography.
| Section | Setting | Modes |
|---|---|---|
| General | Line height | both |
| General | Paragraph spacing | both |
| Headings | Above / below / size / weight ×6 | both |
| Lists | Space above/below, item gap (unordered) | both |
| Lists | Space above/below, item gap (ordered) | both |
| Lists | Internal paragraph gap | reading |
| Lists | Indentation per level / line height | both |
| Blockquotes | Above / below / internal | reading |
| Code blocks | Above / below / line height | both |
| Tables | Above / below / cell padding / line height | reading (line height: both) |
| Horizontal rules | Above / below | both |
| Callouts | Above / below | reading (+ editing widgets) |
| Math blocks | Above / below | both |
| Embedded content | Above / below | reading |
Obsidian renders reading mode as static HTML and editing mode with CodeMirror 6, where live blocks (tables, callouts, embeds, …) appear as embedded widgets. The two pipelines have different DOM structures and layout engines, so while the plugin aligns typography as closely as possible, minor visual differences on some embedded elements between the two modes are unavoidable. If a difference bothers you, please report it (see below) — reports with concrete examples help improve the alignment rules.
Found a spacing inconsistency between the two modes, or any other issue? Please open an issue on GitHub — a screenshot comparing reading mode and editing mode side by side makes diagnosis much faster. Feature requests and pull requests are welcome too.
:has(), available since Obsidian
1.2).!important so they win over
theme defaults. Disable the master toggle to compare against your theme.MIT