Now I understand the setup. The sindresorhus CSS targets .markdown-body class, but markdown-mode puts content directly in <body>. I need to:
<article class="markdown-body">Now update the emacs config to wrap the markdown preview content in a <article class="markdown-body"> element so the CSS selectors match.
Done. Here's what I changed:
github.css - Replaced the old hand-rolled CSS (normalize.css v3 + custom GitHub-ish styles) with the full sindresorhus/github-markdown-css. This includes light/dark mode support via prefers-color-scheme. I added a small body { padding: 30px } rule at the top so the preview isn't edge-to-edge.
dotemacs_template (lines 364-366) - Added markdown-xhtml-body-preamble and markdown-xhtml-body-epilogue to wrap the preview content in <article class="markdown-body">, which is what the sindresorhus CSS targets. The CSS file path (markdown-css-paths) was already correct.
Sure, just need to set the body background to match the dark mode background.
That sets the body background to match the --bgColor-default values from the dark (#0d1117) and light (#ffffff) themes, so the padding area blends seamlessly.
Thanks! Enjoy the upgraded markdown previews.
You're missing two useful extensions that cmark-gfm supports:
strikethrough - renders ~~text~~ as tasklist - renders - [ ] / - [x] as actual checkboxes (and the sindresorhus CSS you just added already has styles for .task-list-item)Want me to add them?
Let me look at the current CSS and fetch the replacement.
Done.
🤘
Let me check the current CSS file and how markdown-mode generates its HTML.