Skip to content

Commit 4d05960

Browse files
committed
doc: Update README.md
1 parent 3d23b82 commit 4d05960

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ A simple code editor with syntax highlighting. This library aims to provide a si
1414

1515
**`Features:`**
1616

17+
- 🌒 Support dark-mode/night-mode. `@v4`
1718
- ☕️ Automatic syntax highlighting.
1819
- 🐲 Automatic indent on new lines.
1920
- 🩲 Indent line or selected text by pressing tab key, with customizable indentation.
@@ -110,6 +111,32 @@ function HomePage() {
110111
export default HomePage;
111112
```
112113

114+
## Support dark-mode/night-mode
115+
116+
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.
117+
118+
```html
119+
<html data-color-mode="dark">
120+
```
121+
122+
```js
123+
document.documentElement.setAttribute('data-color-mode', 'dark')
124+
document.documentElement.setAttribute('data-color-mode', 'light')
125+
```
126+
127+
Inherit custom color variables by adding `.w-tc-editor-var` selector.
128+
129+
```jsx
130+
const Demo = () => {
131+
return (
132+
<div>
133+
<div className="w-tc-editor-var"> </div>
134+
<CodeEditor value={code} />
135+
</div>
136+
)
137+
}
138+
```
139+
113140
## Props
114141

115142
```ts

0 commit comments

Comments
 (0)