Plugin

Contextual Typography

mgmeyers101.7k

Add a data-tag-name attribute to all top-level divs in preview mode containing the child's tag name, allowing contextual typography styling.

  • Overview
  • Updates
  • Privacy
Add data-tag-name attributes to top-level preview divs for contextual typography. Use this plugin to enable custom styling based on your Markdown structure. Create unique visual hierarchies in your notes without predefined styles.

obsidian-contextual-typography

This plugin adds a data-tag-name attribute to all top-level preview divs, allowing contextual typography. Note: this plugin does not add any styles, but enables contextual styling.

This is specifically inspired by http://matejlatin.github.io/Gutenberg/

Sample

.markdown-preview-view div[data-tag-name="h1"] + div > h2 {
  margin-top: 1.8888888889rem;
}

Before:

Before

After:

After
Created
Dec 15, 2020
Last updated
Jun 16, 2024
Updates
10 releases
Downloads
101.7k
Compatible with
0.9.22+
License
GPL-3.0