These Markdown stylesheets bring the style of GitHub Flavored Markdown on github.com to Markdown previews in Nova.app — and any app that accepts user stylesheets.
Preview exactly how your Markdown and readme.md files will look on GitHub while writing in Nova or your favourite app.
- Nova.app → Settings… → Workspace → Markdown Stylesheet: Custom…
-
Select a stylesheet:
Auto:
github-markdown-auto.css
Dark-only:github-markdown-dark.css
Light-only:github-markdown-light.cssAuto switches between light and dark modes using:
@media (prefers-color-scheme)other available themes
Dark Colorblind High Contrast:
github-markdown-dark_colorblind_high_contrascss
Dark Colorblind:github-markdown-dark_colorblind.css
Dark Dimmed High Contrast:github-markdown-dark_dimmed_high_contrast.css
Dark Dimmed:github-markdown-dark_dimmed.css
Dark High Contrast:github-markdown-dark_high_contrast.css
Dark Tritanopia High Contrast:github-markdown-dark_tritanopia_high_contrascss
Dark Tritanopia:github-markdown-dark_tritanopia.css
Light Colorblind High Contrast:github-markdown-light_colorblind_high_contrt.css
Light Colorblind:github-markdown-light_colorblind.css
Light High Contrast:github-markdown-light_high_contrast.css
Light Tritanopia High Contrast:github-markdown-light_tritanopia_high_contrt.css
Light Tritanopia:github-markdown-light_tritanopia.css
The CSS is generated. Contributions should go to these repository:
All stylesheets were generated by andesco/generate-github-markdown-css using the optional --include flag which prepends include.css to define base styling and responsive padding:
body {
box-sizing: border-box;
min-width: 200px;
max-width: 980px;
margin: 0 auto;
padding: 45px;
}
@media (max-width: 767px) {
body {
padding: 15px;
}
}Generate a CSS file for each possible theme and the auto default:
for THEME in $(github-markdown-css --list) auto; do
github-markdown-css --$THEME=$THEME --root-selector=body --include > github-markdown-$THEME.css
done
This Python script modifies the CSS from sindresorhus/github-markdown-css to generate new stylesheets for Nova.app and other HTML-rendered Markdown.
The script can process all .css files in the current directory and overwrite exisiting files:
python3 transform_css.py --replace
The script makes the following changes:
-
replaces all instances of
.markdown-body␣{withbody␣{ -
removes al all instances of
.markdown-body␣ -
replaces all instances of
.markdown-body,withbody, -
removes any remaining
CSSrules that matches this regex:
^\s*\.markdown-body[^{]*\{[^}]*\} -
inserts this
CSSblock at the beginning of each new file to define base styling and responsive padding:body { box-sizing: border-box; min-width: 200px; max-width: 980px; margin: 0 auto; padding: 45px; } @media (max-width: 767px) { body { padding: 15px; } }
