Skip to content

Commit f01d52b

Browse files
committedJun 4, 2023
doc(codemirror-themes-all): update document.
1 parent 2e3ed1b commit f01d52b

File tree

5 files changed

+184
-9
lines changed

5 files changed

+184
-9
lines changed
 

‎themes/all/README.md

+164
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,170 @@ export * from '@uiw/codemirror-theme-vscode';
8484
export * from '@uiw/codemirror-theme-xcode';
8585
```
8686

87+
## Themes
88+
89+
**abcdef**
90+
91+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/abcdef">
92+
<img width="436" alt="codemirror-theme-abcdef" src="https://user-images.githubusercontent.com/1680273/176573508-705562ad-16ec-4b16-994e-f235a9331a3f.png">
93+
</a>
94+
95+
**android studio**
96+
97+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/xcode/light">
98+
<img width="436" alt="codemirror-theme-androidstudio" src="https://user-images.githubusercontent.com/1680273/177484354-0a4fa43e-de96-409f-83e2-61808f2347e6.png">
99+
</a>
100+
101+
**atom one**
102+
103+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/xcode/light">
104+
<img width="436" alt="codemirror-theme-androidstudio" src="https://user-images.githubusercontent.com/1680273/181795374-7a25cb90-5d77-4f86-9cbc-b1e12dc939d3.png">
105+
</a>
106+
107+
**aura**
108+
109+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/aura">
110+
<img width="436" alt="codemirror-theme-aura" src="https://user-images.githubusercontent.com/1680273/206092773-8140fc6b-119f-4271-a821-7dc6bcbc1c63.png">
111+
</a>
112+
113+
**bbedit**
114+
115+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/bbedit">
116+
<img width="436" alt="codemirror-theme-bbedit" src="https://user-images.githubusercontent.com/1680273/183550552-df398e5b-fab2-4ce5-bdd0-5e3612e3e5d9.png">
117+
</a>
118+
119+
**bespin**
120+
121+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/bespin">
122+
<img width="436" alt="codemirror-theme-bespin" src="https://user-images.githubusercontent.com/1680273/176573408-0fd54981-471a-4ef8-91d4-8ad4b159c1e0.png">
123+
</a>
124+
125+
**darcula**
126+
127+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/darcula">
128+
<img width="436" alt="codemirror-theme-darcula" src="https://user-images.githubusercontent.com/1680273/176573321-3015b1b4-3455-497f-ad16-dd2090d7848d.png">
129+
</a>
130+
131+
**dracula**
132+
133+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/dracula">
134+
<img width="436" alt="codemirror-theme-dracula" src="https://user-images.githubusercontent.com/1680273/176573236-43928ba2-0eb1-4b59-9495-d39b6e3df81c.png">
135+
</a>
136+
137+
**duotone**
138+
139+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/duotone/dark">
140+
<img width="436" alt="codemirror-theme-duotone dark" src="https://user-images.githubusercontent.com/1680273/176572959-adfc1284-4c70-48df-8aeb-9a47ff76b2f2.png">
141+
</a>
142+
143+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/duotone/light">
144+
<img width="436" alt="codemirror-theme-duotone light" src="https://user-images.githubusercontent.com/1680273/176573139-5c22ed62-6000-40da-b080-59c83e6181e2.png">
145+
</a>
146+
147+
**eclipse**
148+
149+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/eclipse">
150+
<img width="436" alt="codemirror-theme-eclipse" src="https://user-images.githubusercontent.com/1680273/176572785-4f56f11a-018b-4f86-9088-e6f71f745cfb.png">
151+
</a>
152+
153+
**github**
154+
155+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/github/dark">
156+
<img width="436" alt="codemirror-theme-github dark" src="https://user-images.githubusercontent.com/1680273/177048035-644af599-aaf1-41d8-86ea-9ea8c3a1a0c5.png">
157+
</a>
158+
159+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/github/light">
160+
<img width="436" alt="codemirror-theme-github light" src="https://user-images.githubusercontent.com/1680273/177048005-32794f23-8bff-4059-babf-21316d886e65.png">
161+
</a>
162+
163+
**gruvbox**
164+
165+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/gruvbox/dark">
166+
<img width="436" alt="codemirror-theme-gruvbox-dark" src="https://user-images.githubusercontent.com/1680273/206087857-d0a85219-34ad-4e79-9cdf-183f67e1085d.png">
167+
</a>
168+
169+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/gruvbox/light">
170+
<img width="436" alt="codemirror-theme-eclipse" src="https://user-images.githubusercontent.com/1680273/206087911-49db6624-ab8c-434e-9b8a-84132fe206f9.png">
171+
</a>
172+
173+
**material**
174+
175+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/material/dark">
176+
<img width="436" alt="codemirror-theme-material" src="https://user-images.githubusercontent.com/1680273/205537793-79f9c99c-831a-4ce3-8189-78b42896656f.png">
177+
</a>
178+
179+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/material/light">
180+
<img width="436" alt="codemirror-theme-material" src="https://user-images.githubusercontent.com/1680273/206124615-b3896e2c-d299-4609-b1d9-523ea1cf9f5b.png">
181+
</a>
182+
183+
**noctis-lilac**
184+
185+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/noctis-lilac">
186+
<img width="436" alt="codemirror-theme-noctis-lilac" src="https://user-images.githubusercontent.com/1680273/206088068-55e9a25b-eb77-4e1a-91bb-f39cbba84981.png">
187+
</a>
188+
189+
**nord**
190+
191+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/nord">
192+
<img width="436" alt="codemirror-theme-nord" src="https://user-images.githubusercontent.com/1680273/205498304-956bc719-1472-40f0-9c3f-21ac5b9f97a6.png">
193+
</a>
194+
195+
**okaidia**
196+
197+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/okaidia">
198+
<img width="436" alt="codemirror-theme-okaidia" src="https://user-images.githubusercontent.com/1680273/176572694-b9aface9-9646-4e0e-a211-a8aa92dabc31.png">
199+
</a>
200+
201+
**solarized**
202+
203+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/solarized/light">
204+
<img width="436" alt="codemirror-theme-solarized" src="https://user-images.githubusercontent.com/1680273/205544435-a080d1d4-6da9-4f1d-aa10-5f2207d31176.png">
205+
</a>
206+
207+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/solarized/dark">
208+
<img width="436" alt="codemirror-theme-solarized" src="https://user-images.githubusercontent.com/1680273/205547403-96db62c3-d061-4dee-88d0-c86ed17e7489.png">
209+
</a>
210+
211+
**sublime**
212+
213+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/sublime">
214+
<img width="436" alt="codemirror-theme-sublime" src="https://user-images.githubusercontent.com/1680273/176572314-cc296f81-0763-485c-8fa2-7d61b24ad09b.png">
215+
</a>
216+
217+
**tokyo-night**
218+
219+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/tokyo-night">
220+
<img width="436" alt="codemirror-theme-tokyo-night" src="https://user-images.githubusercontent.com/1680273/206094521-c3a51de1-8cb7-4f01-a9bd-6cfd04a3aa0d.png">
221+
</a>
222+
223+
**tokyo-night-day**
224+
225+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/tokyo-night-day">
226+
<img width="436" alt="codemirror-theme-tokyo-night-day" src="https://user-images.githubusercontent.com/1680273/206104544-ca4db2e0-caac-4804-9321-c269fe660245.png">
227+
</a>
228+
229+
**tokyo-night-storm**
230+
231+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/tokyo-night-storm">
232+
<img width="436" alt="codemirror-theme-tokyo-night-storm" src="https://user-images.githubusercontent.com/1680273/206097179-8a490b97-87da-4285-a9bc-b0c9f510e7ed.png">
233+
</a>
234+
235+
**vscode**
236+
237+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/vscode/dark">
238+
<img width="436" alt="codemirror-theme-vscode dark" src="https://user-images.githubusercontent.com/1680273/202690670-385808e2-6346-4e36-a3d6-6d9fc1f216dc.png">
239+
</a>
240+
241+
**xcode**
242+
243+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/xcode/dark">
244+
<img width="436" alt="codemirror-theme-xcode dark" src="https://user-images.githubusercontent.com/1680273/206087681-537b9c1f-0dce-42a4-854d-036147935e82.png">
245+
</a>
246+
247+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/xcode/light">
248+
<img width="436" alt="codemirror-theme-xcode light" src="https://user-images.githubusercontent.com/1680273/206087526-9613a546-f129-4e01-9263-5a75f3f039a7.png">
249+
</a>
250+
87251
## Contributors
88252

89253
As always, thanks to our amazing contributors!

‎www/src/pages/extensions/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import styled from 'styled-components';
33
export const PageWarpper = styled.div`
44
flex: 1;
55
max-width: 980px;
6-
padding: 20px 20px 100px 20px;
6+
padding: 20px 20px 30px 20px;
77
`;
88

99
export const Content = styled.div`

‎www/src/pages/extensions/themes/example.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { FC, PropsWithChildren } from 'react';
1+
import { FC, PropsWithChildren, useState } from 'react';
2+
import { Link } from 'react-router-dom';
23
import CodeMirror, { ReactCodeMirrorProps } from '@uiw/react-codemirror';
3-
import { useState } from 'react';
44
import * as themes from '@uiw/codemirror-themes-all';
55
import { langs } from '@uiw/codemirror-extensions-langs';
66
import styled from 'styled-components';
@@ -42,6 +42,8 @@ export const ThemesAllExample: FC<PropsWithChildren<{ source?: string }>> = ({ s
4242
return <option key={index}>{keyname}</option>;
4343
})}
4444
</select>
45+
<br />
46+
<Link to="/theme/home">All Theme Example</Link>
4547
</ToolsWapper>
4648
</PageWarpper>
4749
);

‎www/src/pages/theme/Preview.tsx

+6-5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ interface PreviewProps {
1111
path?: any;
1212
themePkg?: string;
1313
mode?: 'light' | 'dark';
14+
preview?: 'document' | 'example';
1415
}
1516

1617
export const Content = styled.div`
@@ -55,7 +56,7 @@ export const Preview: FC<PropsWithChildren<PreviewProps>> = (props) => {
5556
const { themePkg, mode } = props;
5657
const { mdData } = useMdData(props.path);
5758
const childs = Children.toArray(props.children);
58-
const [previewDoc, setPreviewDoc] = useState(false);
59+
const [previewDoc, setPreviewDoc] = useState<PreviewProps['preview']>(props.preview || 'example');
5960
const themePkgNmae = !!mode ? themePkg?.replace(/-(light|dark)$/, '') : themePkg;
6061
const themeName = themePkgNmae?.replace('@uiw/codemirror-theme-', '').replace('-', ' ');
6162
const themeExtensionName = themePkgNmae?.replace('@uiw/codemirror-theme-', '') + (!!mode ? `-${mode}` : '');
@@ -67,8 +68,8 @@ export const Preview: FC<PropsWithChildren<PreviewProps>> = (props) => {
6768
<Header>
6869
<Title>{themeName} Theme</Title>
6970
<div>
70-
<Button onClick={() => setPreviewDoc(!previewDoc)}>
71-
{previewDoc ? 'Preview Theme Example' : 'Preview Document'}
71+
<Button onClick={() => setPreviewDoc(previewDoc === 'document' ? 'example' : 'document')}>
72+
{previewDoc === 'document' ? 'Preview Theme Example' : 'Preview Document'}
7273
</Button>
7374
</div>
7475
<PreCode value={`npm install ${themePkg} --save`} />
@@ -77,8 +78,8 @@ export const Preview: FC<PropsWithChildren<PreviewProps>> = (props) => {
7778
{childs.map((child, key) => {
7879
return cloneElement(child as any, { key, source: mdData?.source });
7980
})}
80-
{mdData && (previewDoc || !themePkg) && <Markdown source={mdData.source} mdData={mdData} />}
81-
{!previewDoc && themePkg && themeExtensionName && <Sample theme={extension} />}
81+
{mdData && (previewDoc === 'document' || !themePkg) && <Markdown source={mdData.source} mdData={mdData} />}
82+
{previewDoc === 'example' && themePkg && themeExtensionName && <Sample theme={extension} />}
8283
</Content>
8384
</Warpper>
8485
);

‎www/src/router.tsx

+9-1
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ export const routes: MenuRouteObject[] = [
167167
index: true,
168168
element: <Navigate to="home" replace />,
169169
},
170+
{
171+
path: 'all',
172+
element: <Navigate to="/theme/home" replace />,
173+
},
170174
{
171175
path: 'home',
172176
label: 'Home',
@@ -180,7 +184,11 @@ export const routes: MenuRouteObject[] = [
180184
path: 'doc',
181185
label: 'Document',
182186
element: (
183-
<Preview themePkg="@uiw/codemirror-themes" path={() => import('@uiw/codemirror-themes/README.md')} />
187+
<Preview
188+
preview="document"
189+
themePkg="@uiw/codemirror-themes"
190+
path={() => import('@uiw/codemirror-themes/README.md')}
191+
/>
184192
),
185193
},
186194
{

0 commit comments

Comments
 (0)
Please sign in to comment.