Created
July 22, 2026 16:28
-
-
Save vivekascoder/a085afd8b0a3bcd78c97180b1a043f1c to your computer and use it in GitHub Desktop.
Obsidian css snippet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .markdown-rendered table tbody tr:nth-child(even) { | |
| background-color: color-mix( | |
| in srgb, | |
| var(--background-primary) 92%, | |
| var(--text-normal) 3% | |
| ); | |
| } | |
| .markdown-rendered table tbody tr:nth-child(odd) { | |
| background-color: var(--background-primary); | |
| } | |
| /* Keep cells transparent so the row color shows through */ | |
| .markdown-rendered table tbody tr:nth-child(even) td, | |
| .markdown-rendered table tbody tr:nth-child(odd) td { | |
| background-color: transparent; | |
| } | |
| /* Custom heading font */ | |
| body { | |
| /* --heading-font-family: "But Head", serif; */ | |
| --heading-font-family: georgia, serif; | |
| /* Heading font size (2rem) is default for --heading-base-size */ | |
| --heading-base-size: 2.1rem; | |
| --heading-font-weight: 400; | |
| /* Heading fonts */ | |
| --h1-font: var(--heading-font-family); | |
| --h2-font: var(--heading-font-family); | |
| --h3-font: var(--heading-font-family); | |
| --h4-font: var(--heading-font-family); | |
| --h5-font: var(--heading-font-family); | |
| --h6-font: var(--heading-font-family); | |
| --h1-weight: var(--heading-font-weight); | |
| --h2-weight: var(--heading-font-weight); | |
| --h3-weight: var(--heading-font-weight); | |
| --h4-weight: var(--heading-font-weight); | |
| --h5-weight: var(--heading-font-weight); | |
| --h6-weight: var(--heading-font-weight); | |
| /* --h1-style: talic; | |
| --h2-style: italic; */ | |
| --h1-size: var(--heading-base-size); | |
| --h2-size: calc(var(--heading-base-size) * 0.8); | |
| --h3-size: calc(var(--heading-base-size) * 0.68); | |
| --h4-size: calc(var(--heading-base-size) * 0.58); | |
| --h5-size: calc(var(--heading-base-size) * 0.5); | |
| --h6-size: calc(var(--heading-base-size) * 0.45); | |
| } | |
| /* Wikipedia-style divider under H1 and H2 */ | |
| .markdown-rendered h1, | |
| .markdown-rendered h2, | |
| .markdown-rendered h3, | |
| .markdown-source-view .HyperMD-header-1, | |
| .markdown-source-view .HyperMD-header-2, | |
| .markdown-source-view .HyperMD-header-3 { | |
| border-bottom: 2px solid var(--background-modifier-border); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment