Skip to content

Commit eaa44a5

Browse files
committed
doc: Update README.md
1 parent 4eb1a66 commit eaa44a5

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ React component preview markdown text in web browser. The minimal amount of CSS
1313

1414
## Features
1515

16-
- 🌒 Support dark-mode/night mode. `@v4`
16+
- 🌒 Support dark-mode/night-mode. `@v4`
1717
- 🙆🏼‍♂️ GitHub style: The markdown content is rendered as close to the way it's rendered on GitHub as possible.
1818
- 🏋🏾‍♂️ Support [GFM](https://github.github.com/gfm/) (autolink literals, footnotes, strikethrough, tables, tasklists).
1919
- 🍭 Support automatic code block highlight.
@@ -140,6 +140,19 @@ Here is a simple footnote[^1]. With some additional text after it.
140140
[^1]: My reference.
141141
```
142142

143+
## Support dark-mode/night-mode
144+
145+
By default, the `dark-mode` is automatically switched according to the system. If you need to switch manually, just set the `data-color-mode="dark"` parameter for body.
146+
147+
```html
148+
<body data-color-mode="dark"></body>
149+
```
150+
151+
```js
152+
document.body.setAttribute('data-color-mode', 'dark')
153+
document.body.setAttribute('data-color-mode', 'light')
154+
```
155+
143156
## Development
144157

145158
Runs the project in development mode.

0 commit comments

Comments
 (0)