Generate the CSS for
github-markdown-css
First the GitHub.com CSS is fetched. Then we walk through all rules that could take effect in Markdown content, and then do a custom cleanup. A rendered Markdown with all possible syntax is fetched from GitHub to check if we've done right.
import githubMarkdownCss from 'generate-github-markdown-css';
console.log(await githubMarkdownCss({ light: 'light', dark: 'dark' }));
//=> '.markdown-body { …'
$ npm install --global generate-github-markdown-css
$ github-markdown-css --help
Usage
github-markdown-css > <filename>
Options
--type Theme name: 'light', 'dark', 'auto' or other --list values.
'auto' means using the media query (prefers-color-scheme)
to switch between the 'light' and 'dark' theme.
--list List available themes.
Examples
$ github-markdown-css --list
light
dark
dark_dimmed
dark_high_contrast
dark_colorblind
light_colorblind