Skip to content

thirdnet/generate-github-markdown-css

 
 

Repository files navigation

generate-github-markdown-css

Generate the CSS for github-markdown-css

Get the CSS

See github-markdown-css

How

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.

API

import githubMarkdownCss from 'generate-github-markdown-css';

console.log(await githubMarkdownCss({ light: 'light', dark: 'dark' }));
//=> '.markdown-body { …'

CLI

$ 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

About

Generate the CSS for github-markdown-css

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%