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?
已存档?
是复刻?
已锁定?
是镜像?
是私有?