Skip to content

Commit 58b3fb8

Browse files
committed
doc: Update README.md
1 parent df14b1c commit 58b3fb8

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,32 @@ function HomePage() {
147147
export default HomePage;
148148
```
149149

150+
## Support dark-mode/night-mode
151+
152+
By default, the [`dark-mode`](https://github.com/jaywcjlove/dark-mode/) is automatically switched according to the system. If you need to switch manually, just set the `data-color-mode="dark"` parameter for html Element.
153+
154+
```html
155+
<html data-color-mode="dark">
156+
```
157+
158+
```js
159+
document.documentElement.setAttribute('data-color-mode', 'dark')
160+
document.documentElement.setAttribute('data-color-mode', 'light')
161+
```
162+
163+
Inherit custom color variables by adding `.wmde-markdown-var` selector.
164+
165+
```jsx
166+
const Demo = () => {
167+
return (
168+
<div>
169+
<div className="wmde-markdown-var"> </div>
170+
<MarkdownEditor value="Hello Markdown!" />
171+
</div>
172+
)
173+
}
174+
```
175+
150176
## Props
151177

152178
- `value (string)` - the raw markdown that will be converted to html (**required**)

0 commit comments

Comments
 (0)