Compare commits

...

72 Commits
v2.0.5 ... main

Author SHA1 Message Date
Sindre Sorhus
b3977a0367 5.5.1 2024-02-04 13:17:09 +07:00
Sindre Sorhus
9411b377b5 Fix compatibility with Rollup
Fixes #111
2024-02-04 13:15:34 +07:00
Sindre Sorhus
220cab500a 5.5.0 2023-12-11 15:12:33 +01:00
Sindre Sorhus
f03290ff30 Regenerate GitHub CSS 2023-12-11 15:11:26 +01:00
Sindre Sorhus
b336b4215c 5.4.0 2023-11-01 16:13:19 +07:00
Sindre Sorhus
1363826bdf Regenerate GitHub CSS 2023-11-01 16:11:31 +07:00
Sindre Sorhus
f45eec9fe1 5.3.0 2023-10-11 02:30:18 +07:00
Sindre Sorhus
b8b9732e99 Regenerate GitHub CSS 2023-10-11 02:28:57 +07:00
Sindre Sorhus
5ec832f378 5.2.0 2023-02-10 23:26:07 +07:00
Sindre Sorhus
2380451e75 Regenerate GitHub CSS 2023-02-10 15:44:46 +07:00
Sindre Sorhus
ec90c8c72e Meta tweaks 2022-07-08 13:32:50 +02:00
Titus
9719250aca
Add mention of starry-night to readme (#102) 2022-05-16 00:19:35 +07:00
Sindre Sorhus
afa572390d 5.1.0 2021-12-06 01:58:07 +01:00
Sindre Sorhus
95f4064ac3 Regenerate GitHub CSS 2021-12-06 01:56:15 +01:00
Sindre Sorhus
4dc9af74a5 5.0.0 2021-10-17 19:17:58 +07:00
hyrious
5a667d5749
Support GitHub dark theme (#89) 2021-10-17 19:15:46 +07:00
Sindre Sorhus
b1d8b9fc0d
Update readme.md 2021-09-05 11:19:21 +02:00
haru
4869cfc433
Fix "Fork me on Github" image (#83)
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
2021-08-08 11:55:05 +02:00
Rongjian Zhang
888d5a0322
Update GFM render API link (#75) 2020-10-20 14:24:11 +02:00
Sindre Sorhus
1485dd78f5 4.0.0 2020-02-22 18:41:22 +07:00
Sindre Sorhus
28b11434c1 Regenerate GitHub CSS 2020-02-22 18:16:26 +07:00
Atsushi Yamamoto
8e8d8570e8 Add render instruction for code syntax highlighting (#66)
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
2019-06-19 21:17:48 +07:00
Sindre Sorhus
6616212a2a 3.0.1 2019-02-01 16:38:35 +07:00
Sindre Sorhus
12ab131553 Fix invalid CSS caused by copy-paste mistake
Fixes #63
2019-02-01 16:38:11 +07:00
Sindre Sorhus
e3c7e7f89d 3.0.0 2019-01-31 23:41:47 +07:00
Sindre Sorhus
7b0d2e1014 Drop support for Bower 2019-01-31 23:39:10 +07:00
Sindre Sorhus
0d25bb4525 Regenerate GitHub CSS 2019-01-31 23:37:11 +07:00
Sindre Sorhus
4d639a534a 2.10.0 2017-12-31 13:55:32 +01:00
Sindre Sorhus
e91ece348f Regenerate GitHub CSS 2017-12-31 13:54:15 +01:00
Sindre Sorhus
7308c9ab9a 2.9.0 2017-10-15 13:56:03 +07:00
Sindre Sorhus
09cdf605da Meta tweaks 2017-10-15 13:55:26 +07:00
Sindre Sorhus
a5b85d1821 Regenerate GitHub CSS
Closes #49
2017-10-15 13:43:38 +07:00
Danny Guo
3d272011a5 Add a link to the CDNJS page (#47) 2017-08-18 09:17:17 +07:00
Sindre Sorhus
3fc8bc8a14 2.8.0 2017-06-15 12:47:16 +02:00
Sindre Sorhus
db0ab249ce Regenerate GitHub CSS 2017-06-15 12:45:30 +02:00
Jeff Puckett
c59b17b20d Document mobile responsiveness (#45) 2017-06-15 12:43:33 +02:00
Sindre Sorhus
576e8f6479 2.7.0 2017-06-11 22:53:56 +02:00
Sindre Sorhus
6572802925 Regenerate GitHub CSS 2017-06-11 22:51:09 +02:00
Sindre Sorhus
9981e77689 2.6.0 2017-04-02 10:43:19 +07:00
Sindre Sorhus
f7cd505bfa Regenerate GitHub CSS
Fixes #43
2017-04-02 10:37:09 +07:00
Sindre Sorhus
322382b050 2.5.0 2017-03-26 15:34:58 +07:00
Sindre Sorhus
34876406f5 Regenerate GitHub CSS 2017-03-26 15:34:32 +07:00
Sindre Sorhus
7b86e65de4 2.4.1 2016-09-22 23:39:31 +07:00
Sindre Sorhus
016093225b regenerate GitHub CSS 2016-09-22 23:38:28 +07:00
Sindre Sorhus
f73e0a064d 2.4.0 2016-08-04 13:03:36 +02:00
Sindre Sorhus
d666bcdd41 regenerate GitHub CSS to the new style
fixes #30
2016-08-04 12:37:52 +02:00
Sindre Sorhus
b526564124 remove moot ! in build script
#27
2016-05-03 19:48:47 +07:00
Sindre Sorhus
dece7585bb 2.3.0 2016-05-03 17:20:53 +07:00
Sindre Sorhus
b6428abecd regenerate github css 2016-05-03 17:20:43 +07:00
Sindre Sorhus
ac5e7d1dcf bump dependencies 2016-05-03 17:15:50 +07:00
Sindre Sorhus
033e86abcb 2.2.1 2016-01-23 13:16:39 +01:00
Sindre Sorhus
a16c76cfcb add "main" field in package.json - fixes #23 2016-01-23 13:16:13 +01:00
Sindre Sorhus
b99cdc49a3 change generation command name 2016-01-23 13:15:24 +01:00
Sindre Sorhus
2639504756 2.2.0 2016-01-09 16:41:08 +01:00
Tyler Long
029b30908f Close #22 PR: Fix octicons issue & More comprehensive demo page. 2016-01-09 16:39:53 +01:00
Sindre Sorhus
2120fb447b update to new GitHub readme width 2015-12-06 19:56:04 +01:00
Sindre Sorhus
ac2b917fc3 2.1.1 2015-11-30 14:14:16 +07:00
Sindre Sorhus
33f885115b regenerate github css 2015-11-30 14:13:54 +07:00
Sindre Sorhus
8da2badcd5 2.1.0 2015-10-19 01:36:54 +07:00
Sindre Sorhus
1c6099e340 regenerate github css 2015-10-19 01:36:45 +07:00
Sindre Sorhus
897c52802e 2.0.11 2015-10-04 21:08:36 +07:00
Sindre Sorhus
1829d3972e regenerate github css 2015-10-04 21:08:27 +07:00
Sindre Sorhus
5c797a57e8 2.0.10 2015-09-02 14:21:34 +07:00
Sindre Sorhus
77612f1aab regenerate github css 2015-09-02 14:21:25 +07:00
Sindre Sorhus
66bde9cbf9 2.0.9 2015-06-05 03:13:14 +02:00
Sindre Sorhus
bb90abdda8 regenerate github css 2015-06-05 03:12:57 +02:00
Sindre Sorhus
ef6bc860e8 2.0.8 2015-04-15 12:57:33 +07:00
Sindre Sorhus
1f877b6522 regenerate github css 2015-04-15 12:56:20 +07:00
Sindre Sorhus
4cac7ec8c6 2.0.7 2015-03-11 02:46:59 +08:00
Sindre Sorhus
8ea32e927f regenerate github css 2015-03-11 02:46:29 +08:00
Sindre Sorhus
a5fd2bc5c8 2.0.6 2015-03-07 13:34:11 +08:00
Sindre Sorhus
80183241e1 regenerate github css 2015-03-07 13:33:29 +08:00
13 changed files with 4941 additions and 430 deletions

View File

@ -7,9 +7,6 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[package.json]
[*.yml]
indent_style = space
indent_size = 2
[*.md]
trim_trailing_whitespace = false

2
.gitattributes vendored
View File

@ -1 +1 @@
* text=auto
* text=auto eol=lf

3
.github/security.md vendored Normal file
View File

@ -0,0 +1,3 @@
# Security Policy
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.

1
.gitignore vendored
View File

@ -1 +1,2 @@
node_modules
yarn.lock

1
.npmrc Normal file
View File

@ -0,0 +1 @@
package-lock=false

View File

@ -1,19 +0,0 @@
{
"name": "github-markdown-css",
"description": "The minimal amount of CSS to replicate the GitHub Markdown style",
"license": "MIT",
"main": "github-markdown.css",
"keywords": [
"github",
"markdown",
"md",
"css",
"style",
"stylesheet"
],
"ignore": [
"**/.*",
"package.json",
"index.html"
]
}

1084
github-markdown-dark.css Normal file

File diff suppressed because it is too large Load Diff

1083
github-markdown-light.css Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1863
index.html

File diff suppressed because it is too large Load Diff

22
license
View File

@ -1,21 +1,9 @@
The MIT License (MIT)
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,33 +1,40 @@
{
"name": "github-markdown-css",
"version": "2.0.5",
"description": "The minimal amount of CSS to replicate the GitHub Markdown style",
"license": "MIT",
"repository": "sindresorhus/github-markdown-css",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "http://sindresorhus.com"
},
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"generate": "github-markdown-css !> github-markdown.css"
},
"files": [
"github-markdown.css"
],
"keywords": [
"browser",
"github",
"markdown",
"md",
"css",
"style",
"stylesheet"
],
"devDependencies": {
"generate-github-markdown-css": "^1.0.1"
}
"name": "github-markdown-css",
"version": "5.5.1",
"description": "The minimal amount of CSS to replicate the GitHub Markdown style",
"license": "MIT",
"repository": "sindresorhus/github-markdown-css",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"main": "github-markdown.css",
"engines": {
"node": ">=10"
},
"scripts": {
"make:light": "github-markdown-css --type light > github-markdown-light.css",
"make:dark": "github-markdown-css --type dark > github-markdown-dark.css",
"make:auto": "github-markdown-css --type auto > github-markdown.css",
"make": "npm run make:light && npm run make:dark && npm run make:auto"
},
"files": [
"github-markdown.css",
"github-markdown-dark.css",
"github-markdown-light.css"
],
"keywords": [
"browser",
"github",
"markdown",
"md",
"css",
"style",
"stylesheet"
],
"devDependencies": {
"generate-github-markdown-css": "^6.2.0"
}
}

View File

@ -2,36 +2,40 @@
> The minimal amount of CSS to replicate the GitHub Markdown style
**The CSS is generated. Contributions should go to [this repo](https://github.com/sindresorhus/generate-github-markdown-css).**
[<img src="https://cloud.githubusercontent.com/assets/170270/5219062/f22a978c-7685-11e4-8316-af25b6c89bc0.png" width="300">](http://sindresorhus.com/github-markdown-css)
## [Demo](http://sindresorhus.com/github-markdown-css)
## [Demo](https://sindresorhus.com/github-markdown-css)
## Install
Download [manually](https://raw.githubusercontent.com/sindresorhus/github-markdown-css/gh-pages/github-markdown.css) or with a package-manager.
Download [manually](https://raw.githubusercontent.com/sindresorhus/github-markdown-css/gh-pages/github-markdown.css), from [CDNJS](https://cdnjs.com/libraries/github-markdown-css), or with npm:
```sh
$ npm install --save github-markdown-css
npm install github-markdown-css
```
```sh
$ bower install --save 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 `790px` width and `30px` padding.
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.
```html
<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: 790px;
max-width: 980px;
margin: 0 auto;
padding: 30px;
padding: 45px;
}
@media (max-width: 767px) {
.markdown-body {
padding: 15px;
}
}
</style>
<article class="markdown-body">
@ -40,17 +44,20 @@ Import the `github-markdown.css` file and add a `markdown-body` class to the con
</article>
```
You can use [GitHub's `/markdown` API](https://docs.github.com/en/free-pro-team@latest/rest/reference/markdown) to turn Markdown into the HTML that GitHub generates, which works well with the CSS in this repo. Other Markdown parsers will mostly work with these styles too. To mimic how GitHub highlights code, you can use [`starry-night`](https://github.com/wooorm/starry-night) with your Markdown parser of choice.
There are 3 themes provided in this package:
- **github-markdown.css**: (default) Automatically switches between light and dark through [`@media (prefers-color-scheme)`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme).
- **github-markdown-light.css**: Light-only.
- **github-markdown-dark.css**: Dark-only.
You may know that now GitHub supports more than 2 themes including `dark_dimmed`, `dark_high_contrast` and `colorblind` variants. If you want to try these themes, you can generate them on your own! See next section.
## How
See [`generate-github-markdown-css`](https://github.com/sindresorhus/generate-github-markdown-css) for how it's generated and ability to generate your own.
## Dev
Run `npm run generate` to update the CSS.
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)
Run `npm run make` to update the CSS.