github-markdown-css

The minimal amount of CSS to replicate the GitHub Markdown style

  • Owner: sindresorhus/github-markdown-css
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

github-markdown-css

The minimal amount of CSS to replicate the GitHub Markdown style

Demo

Install

Download manually, from CDNJS, or with npm:

$ npm install github-markdown-css

Usage

Import the github-markdown.css file and add a markdown-body class to the container of your rendered Markdown and set a width for it. GitHub uses 980px width and 45px padding, and 15px padding for mobile.

<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="github-markdown.css">
<style>
	.markdown-body {
		box-sizing: border-box;
		min-width: 200px;
		max-width: 980px;
		margin: 0 auto;
		padding: 45px;
	}

	@media (max-width: 767px) {
		.markdown-body {
			padding: 15px;
		}
	}
</style>
<article class="markdown-body">
	<h1>Unicorns</h1>
	<p>All the things</p>
</article>

If you want code syntax highlighted, use GitHub Flavored Markdown rendered from GitHub's /markdown API.

How

See generate-github-markdown-css for how it's generated and ability to generate your own.

Dev

Run npm run make to update the CSS.

License

MIT © Sindre Sorhus

Main metrics

Overview
Name With Ownersindresorhus/github-markdown-css
Primary LanguageCSS
Program languageCSS (Language Count: 2)
Platform
License:MIT License
所有者活动
Created At2014-05-07 18:03:02
Pushed At2024-12-20 15:16:57
Last Commit At
Release Count51
Last Release Namev5.8.1 (Posted on 2024-11-28 15:43:27)
First Release Name0.1.0 (Posted on 2014-05-07 20:25:46)
用户参与
Stargazers Count8.4k
Watchers Count91
Fork Count2.1k
Commits Count139
Has Issues Enabled
Issues Count73
Issue Open Count13
Pull Requests Count10
Pull Requests Open Count0
Pull Requests Close Count38
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private