github-markdown-css

Drop-in CSS that renders any markdown container in GitHub's exact visual style, light or dark.

Library
npm
v5.9.0
8,936 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
61 /100 Good
Development Activity 48
Maintenance 24
Community 72
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
35 /100 Needs Attention
Architecture 35
Code Quality 25
Innovation 35
Learning Curve 45

github-markdown-css packages the exact stylesheet GitHub itself uses to render markdown into a single importable CSS file. Point it at a .markdown-body container around your rendered HTML and paragraphs, headings, tables, code blocks, and blockquotes all pick up GitHub’s spacing, typography, and colors — no manual styling required.

The package ships seven pre-built theme variants: an automatic light/dark file driven by prefers-color-scheme, dedicated light and dark stylesheets, dark dimmed, dark and light colorblind-safe variants, and a dark high-contrast theme. The CSS itself is generated by a companion tool, generate-github-markdown-css, which derives from GitHub’s own Primer styles, so the visual fidelity stays authentic without hand-tuned CSS to maintain.

What You Get

  • Seven ready-to-use theme files covering auto, light, dark, dark dimmed, dark high-contrast, and two colorblind-safe variants
  • A single .markdown-body class that scopes all rules so the stylesheet never leaks into the rest of your page
  • Faithful reproduction of GitHub’s typography, spacing, table borders, code block backgrounds, and blockquote styling
  • A hosted demo page and CDN availability (CDNJS) alongside the npm package for drop-in use without a build step

Common Use Cases

  • Rendering README or markdown-derived HTML inside a documentation site or internal tool so it matches GitHub’s look
  • Styling a markdown preview pane in a CMS, wiki, or note-taking app
  • Displaying GitHub API /markdown endpoint output or a client-side markdown parser’s HTML with authentic GitHub styling
  • Building changelog and release-notes pages that render markdown content consistently with a project’s GitHub presence

Under The Hood

Architecture The repository is a pure distribution package — no application code or runtime is present. Seven static CSS files (github-markdown.css plus six theme variants) sit at the root alongside a demo index.html and a readme; the package.json’s files array whitelists exactly these seven files for npm publishing, and main points at the default auto-theme file. There is no source directory, no build step invoked at install time, and no logic to trace: generation happens in a separate companion repository (generate-github-markdown-css), which derives from GitHub’s Primer design tokens and emits these CSS files as build artifacts checked directly into this repo. Consuming the package is a single <link> or import of one of the seven files plus wrapping content in a .markdown-body container — there’s no abstraction to break because there’s essentially no abstraction at all.

Tech Stack The published artifact is plain CSS with no preprocessor, bundler, or framework in the shipped output. The only tooling present is a devDependency on generate-github-markdown-css (^6.6.0), invoked through seven npm run make:* scripts, one per theme, each piping the generator’s output into a static .css file; there’s no webpack, PostCSS, or Sass step visible in this repo itself. The package targets Node >=10 purely for the generator script, not for anything the consumer needs — end users just serve or import the resulting CSS files, optionally via CDNJS instead of npm.

Code Quality There are no test files and no CI workflow (.github/ contains only a security.md); the only tooling configuration is an .editorconfig for indentation conventions. This is consistent with the package’s nature: with no executable logic, correctness is instead validated visually against GitHub’s own rendering (via the linked demo page) and delegated to the separate generator project, which is where any testing of the generation logic would live. Naming follows a flat, predictable github-markdown[-theme].css scheme with no ambiguity.

API Design Integration requires exactly one <link>/import and one CSS class (.markdown-body) — about as low-friction as a styling dependency can be, and the seven theme files map cleanly onto light/dark/high-contrast/colorblind needs without requiring any JavaScript to pick a variant beyond the OS-driven default file. The tradeoff is that theming is file-selection based rather than configurable via CSS custom properties, so switching themes means swapping which stylesheet is linked rather than toggling a class or variable — a reasonable but somewhat coarse design for a purely presentational package.

Used by 6 apps in this directory

Go
59%
Apache 2.0

agent-orchestrator

AI Agents · AI Code Assistants · Developer Tools

12,440

A local desktop workspace that gives every coding task its own agent, Git branch, and worktree, then tracks tasks, pull requests, CI, and reviews for 27 coding agents on one live Kanban board.

View details
86
Repo Health
83
Technical
68
Dependency
Built with
Go 59%
TypeScript 38%
Updated 5 days ago
Go
92%
AGPL 3.0

BillionMail

Marketing

15,695

Self-hosted email server and marketing platform that gives you unlimited sending, full deliverability control, and AI-assisted campaigns without monthly fees.

View details
52
Repo Health
74
Technical
70
Dependency
Built with
Go 92%
Updated 3 months ago
TypeScript
94%
AGPL 3.0

Element Web

Collaboration · Team Chat

13,518

A polished, self-hostable Matrix client for secure, decentralized messaging and collaboration that puts your organization in full control of its data.

View details
96
Repo Health
83
Technical
65
Dependency
Built with
TypeScript 94%
Updated 6 days ago
Python
51%
AGPL 3.0

LearnHouse

CMS · Learning Management

2,301

Open-source LMS with AI tutoring, real-time collaboration boards, live code execution, and built-in course monetization — self-hosted in minutes.

View details
90
Repo Health
77
Technical
66
Dependency
Built with
Python 51%
TypeScript 48%
Updated 6 days ago
TypeScript
88%
GPL 3.0

NoteGen

AI Assistants · Knowledge Management · Note Taking

12,848

Capture anything first, then let AI transform your scattered records into polished, structured Markdown notes with RAG-powered knowledge retrieval.

View details
86
Repo Health
74
Technical
67
Dependency
Built with
TypeScript 88%
Updated 1 weeks ago
Python
76%
Apache 2.0

Second Me

AI Assistants · Productivity

15,690

Train a locally hosted AI twin on your own memories—then connect it to the world through a decentralized identity network.

View details
41
Repo Health
75
Technical
67
Dependency
Built with
Python 76%
TypeScript 19%
Updated 1 years ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers