explaingit

sindresorhus/github-markdown-css

Analysis updated 2026-06-24

8,861CSSAudience · developerComplexity · 1/5Setup · easy

TLDR

A CSS stylesheet that makes Markdown content look exactly like GitHub's styling. Drop it into any webpage to replicate GitHub's visual appearance for README files and documentation, with seven theme variants including dark mode and high contrast.

Mindmap

mindmap
  root((github-markdown-css))
    What it does
      Replicates GitHub styling
      Auto light/dark mode
      Seven theme variants
    Tech Stack
      CSS only
      Generated automatically
    Use Cases
      Documentation sites
      Code editors
      Markdown viewer tools
    Audience
      Frontend developers
      Tool builders
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Build a documentation site where Markdown renders with GitHub's familiar visual style.

USE CASE 2

Add GitHub-style Markdown previews to a code editor or developer tool.

USE CASE 3

Replicate GitHub's dark mode and high-contrast themes in a custom web application.

USE CASE 4

Serve Markdown-based content that automatically switches between light and dark based on the visitor's OS preference.

What is it built with?

CSS

How does it compare?

sindresorhus/github-markdown-cssvinceliuice/whitesur-gtk-themekmaasrud/awesome-obsidian
Stars8,8618,8658,790
LanguageCSSCSSCSS
Setup difficultyeasyeasyeasy
Complexity1/52/51/5
Audiencedevelopergeneralgeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

In plain English

This is a CSS stylesheet that makes text rendered from Markdown look exactly like it does on GitHub. Markdown is a lightweight way to write formatted text using plain characters, and GitHub converts it into HTML when displaying README files, comments, and documentation. This project captures the visual styling GitHub applies to that HTML so you can replicate it on your own website or application. Using it is straightforward: you include the CSS file in your page, wrap your rendered Markdown content in an element with the class markdown-body, and the styling takes over. The package includes seven theme variants covering light mode, dark mode, high contrast, and colorblind-friendly options. The default stylesheet automatically switches between light and dark based on the visitor's operating system preference. The CSS in this repository is generated automatically from a companion tool rather than written by hand. If you want to contribute changes or generate a custom version, the README points to the generator repository. This is a frontend utility for developers building tools that display Markdown content and want it to look familiar to GitHub users.

Copy-paste prompts

Prompt 1
I'm using sindresorhus/github-markdown-css. Show me how to set up a basic HTML page that renders Markdown with GitHub's exact styling, including automatic dark mode switching based on OS preference.
Prompt 2
How do I add the github-markdown-css dark theme to my React app that already converts Markdown to HTML? Show me the import and the wrapper element I need.
Prompt 3
I'm building a tool that displays GitHub README files. Show me how to use github-markdown-css so the output looks identical to how GitHub renders it, including code block styling.
Prompt 4
How do I use the high-contrast variant of github-markdown-css for accessibility purposes?

Frequently asked questions

What is github-markdown-css?

A CSS stylesheet that makes Markdown content look exactly like GitHub's styling. Drop it into any webpage to replicate GitHub's visual appearance for README files and documentation, with seven theme variants including dark mode and high contrast.

What language is github-markdown-css written in?

Mainly CSS. The stack also includes CSS.

How hard is github-markdown-css to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is github-markdown-css for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.