github-markdown-css

The minimal amount of CSS to replicate the GitHub Markdown style

  • 所有者: sindresorhus/github-markdown-css
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

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

主要指標

概覽
名稱與所有者sindresorhus/github-markdown-css
主編程語言CSS
編程語言CSS (語言數: 2)
平台
許可證MIT License
所有者活动
創建於2014-05-07 18:03:02
推送於2025-09-17 09:02:53
最后一次提交
發布數51
最新版本名稱v5.8.1 (發布於 2024-11-28 15:43:27)
第一版名稱0.1.0 (發布於 2014-05-07 20:25:46)
用户参与
星數8.6k
關注者數89
派生數2.1k
提交數140
已啟用問題?
問題數74
打開的問題數12
拉請求數10
打開的拉請求數0
關閉的拉請求數39
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?