Skip to content

Instantly share code, notes, and snippets.

@qazer2687
Last active June 2, 2025 20:41
Show Gist options
  • Select an option

  • Save qazer2687/18b836fb6655cfe7f590ae49d61ce9c9 to your computer and use it in GitHub Desktop.

Select an option

Save qazer2687/18b836fb6655cfe7f590ae49d61ce9c9 to your computer and use it in GitHub Desktop.
This CSS snippet displays header markdown when in live preview.
/* Made by @qazer2687 on GitHub. */
.is-live-preview .cm-header::before {
left: -2px;
color: var(--text-faint);
font-family: var(--font-monospace);
display: inline;
vertical-align: text-top;
}
.is-live-preview .cm-line .cm-header-1::before { content: "# "; }
.is-live-preview .cm-line .cm-header-2::before { content: "## "; }
.is-live-preview .cm-line .cm-header-3::before { content: "### "; }
.is-live-preview .cm-line .cm-header-4::before { content: "#### "; }
.is-live-preview .cm-line .cm-header-5::before { content: "##### "; }
.is-live-preview .cm-line .cm-header-6::before { content: "###### "; }
.is-live-preview .cm-line:has(.cm-formatting-header) .cm-header::before {
display: none;
}
.is-live-preview .cm-header ~ .cm-header::before {
display: none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment