Skip to content

Commit 8dccafa

Browse files
committedAug 29, 2023
feat(theme): add andromeda theme.
1 parent 84613ee commit 8dccafa

File tree

15 files changed

+601
-5
lines changed

15 files changed

+601
-5
lines changed
 

‎.github/workflows/ci.yml

+7
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,13 @@ jobs:
172172
env:
173173
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
174174

175+
- name: 📦 @uiw/codemirror-theme-andromeda publish to NPM
176+
run: npm publish --access public
177+
working-directory: ./themes/andromeda/
178+
continue-on-error: true
179+
env:
180+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
181+
175182
- name: 📦 @uiw/codemirror-theme-atomone publish to NPM
176183
run: npm publish --access public
177184
working-directory: ./themes/atomone/

‎core/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ npm install @uiw/react-codemirror --save
5959
| `@uiw/codemirror-theme-abcdef` | [![npm version](https://img.shields.io/npm/v/@uiw/codemirror-theme-abcdef.svg)](https://www.npmjs.com/package/@uiw/codemirror-theme-abcdef) [![NPM Downloads](https://img.shields.io/npm/dm/@uiw/codemirror-theme-abcdef.svg?style=flat)](https://www.npmjs.com/package/@uiw/codemirror-theme-abcdef) | [`#preview`](https://uiwjs.github.io/react-codemirror/#/theme/data/abcdef) |
6060
| `@uiw/codemirror-theme-abyss` | [![npm version](https://img.shields.io/npm/v/@uiw/codemirror-theme-abyss.svg)](https://www.npmjs.com/package/@uiw/codemirror-theme-abyss) [![NPM Downloads](https://img.shields.io/npm/dm/@uiw/codemirror-theme-abyss.svg?style=flat)](https://www.npmjs.com/package/@uiw/codemirror-theme-abyss) | [`#preview`](https://uiwjs.github.io/react-codemirror/#/theme/data/abyss) |
6161
| `@uiw/codemirror-theme-androidstudio` | [![npm version](https://img.shields.io/npm/v/@uiw/codemirror-theme-androidstudio.svg)](https://www.npmjs.com/package/@uiw/codemirror-theme-androidstudio) [![NPM Downloads](https://img.shields.io/npm/dm/@uiw/codemirror-theme-androidstudio.svg?style=flat)](https://www.npmjs.com/package/@uiw/codemirror-theme-androidstudio) | [`#preview`](https://uiwjs.github.io/react-codemirror/#/theme/data/androidstudio) |
62+
| `@uiw/codemirror-theme-andromeda` | [![npm version](https://img.shields.io/npm/v/@uiw/codemirror-theme-andromeda.svg)](https://www.npmjs.com/package/@uiw/codemirror-theme-andromeda) [![NPM Downloads](https://img.shields.io/npm/dm/@uiw/codemirror-theme-andromeda.svg?style=flat)](https://www.npmjs.com/package/@uiw/codemirror-theme-andromeda) | [`#preview`](https://uiwjs.github.io/react-codemirror/#/theme/data/andromeda) |
6263
| `@uiw/codemirror-theme-atomone` | [![npm version](https://img.shields.io/npm/v/@uiw/codemirror-theme-atomone.svg)](https://www.npmjs.com/package/@uiw/codemirror-theme-atomone) [![NPM Downloads](https://img.shields.io/npm/dm/@uiw/codemirror-theme-atomone.svg?style=flat)](https://www.npmjs.com/package/@uiw/codemirror-theme-atomone) | [`#preview`](https://uiwjs.github.io/react-codemirror/#/theme/data/atomone) |
6364
| `@uiw/codemirror-theme-aura` | [![npm version](https://img.shields.io/npm/v/@uiw/codemirror-theme-aura.svg)](https://www.npmjs.com/package/@uiw/codemirror-theme-aura) [![NPM Downloads](https://img.shields.io/npm/dm/@uiw/codemirror-theme-aura.svg?style=flat)](https://www.npmjs.com/package/@uiw/codemirror-theme-aura) | [`#preview`](https://uiwjs.github.io/react-codemirror/#/theme/data/aura) |
6465
| `@uiw/codemirror-theme-basic` | [![npm version](https://img.shields.io/npm/v/@uiw/codemirror-theme-basic.svg)](https://www.npmjs.com/package/@uiw/codemirror-theme-basic) [![NPM Downloads](https://img.shields.io/npm/dm/@uiw/codemirror-theme-basic.svg?style=flat)](https://www.npmjs.com/package/@uiw/codemirror-theme-basic) | [`#preview`](https://uiwjs.github.io/react-codemirror/#/theme/data/bbedit) |

‎themes/_scripts/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ Not perfect themes for [cm6](https://github.com/codemirror/dev/), generated from
1313
- [theme-solarized-dark](https://github.com/microsoft/vscode/tree/main/extensions/theme-solarized-dark)
1414
- [theme-solarized-light](https://github.com/microsoft/vscode/tree/main/extensions/theme-solarized-light)
1515
- [theme-tomorrow-night-blue](https://github.com/microsoft/vscode/tree/main/extensions/theme-tomorrow-night-blue)
16+
- [Andromeda](https://github.com/EliverLara/Andromeda/blob/master/themes/Andromeda-color-theme.json)

‎themes/_scripts/data/andromeda.json

+344
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,344 @@
1+
{
2+
"name": "Andromeda",
3+
"type": "dark",
4+
"colors": {
5+
"focusBorder": "#746f77",
6+
"foreground": "#D5CED9",
7+
"widget.shadow": "#14151A",
8+
"selection.background": "#746f77",
9+
"errorForeground": "#FC644D",
10+
11+
"button.background": "#00e8c5cc",
12+
"button.hoverBackground": "#07d4b6cc",
13+
14+
"dropdown.background": "#2b303b",
15+
"dropdown.border": "#363c49",
16+
17+
"input.background": "#2b303b",
18+
"input.placeholderForeground": "#746f77",
19+
"inputOption.activeBorder": "#C668BA",
20+
"inputValidation.errorBackground": "#D65343",
21+
"inputValidation.errorBorder": "#D65343",
22+
"inputValidation.infoBackground": "#3A6395",
23+
"inputValidation.infoBorder": "#3A6395",
24+
"inputValidation.warningBackground": "#DE9237",
25+
"inputValidation.warningBorder": "#DE9237",
26+
27+
"scrollbar.shadow": "#23262E",
28+
"scrollbarSlider.activeBackground": "#3A3F4CCC",
29+
"scrollbarSlider.background": "#3A3F4C77",
30+
"scrollbarSlider.hoverBackground": "#3A3F4CAA",
31+
32+
"badge.background": "#00b0ff",
33+
"badge.foreground": "#20232B",
34+
35+
"progressBar.background": "#C668BA",
36+
37+
"list.activeSelectionBackground": "#23262E",
38+
"list.activeSelectionForeground": "#00e8c6",
39+
"list.dropBackground": "#3a404e",
40+
"list.focusBackground": "#282b35",
41+
"list.focusForeground": "#eee",
42+
"list.hoverBackground": "#23262E",
43+
"list.hoverForeground": "#eee",
44+
"list.inactiveSelectionBackground": "#23262E",
45+
"list.inactiveSelectionForeground": "#00e8c6",
46+
47+
"activityBar.background": "#23262E",
48+
"activityBar.dropBackground": "#3a404e",
49+
"activityBar.foreground": "#BAAFC0",
50+
"activityBarBadge.background": "#00b0ff",
51+
"activityBarBadge.foreground": "#20232B",
52+
53+
"sideBar.background": "#23262E",
54+
"sideBarSectionHeader.background": "#23262E",
55+
"sideBarTitle.foreground": "#00e8c6",
56+
"sideBar.foreground": "#999999",
57+
58+
"editorGroup.background": "#23262E",
59+
"editorGroup.dropBackground": "#495061d7",
60+
"editorGroupHeader.tabsBackground": "#23262E",
61+
"tab.activeBackground": "#23262e",
62+
"tab.inactiveBackground": "#23262E",
63+
"tab.activeForeground": "#00e8c6",
64+
"tab.inactiveForeground": "#746f77",
65+
66+
"editor.background": "#23262E",
67+
"editor.foreground": "#D5CED9",
68+
"editorLineNumber.foreground": "#746f77",
69+
"editorCursor.foreground": "#FFF",
70+
"editor.selectionBackground": "#3D4352",
71+
"editor.selectionHighlightBackground": "#4F435580",
72+
"editor.wordHighlightBackground": "#4F4355",
73+
"editor.wordHighlightStrongBackground": "#db45a280",
74+
"editor.findMatchBackground": "#f39d1256",
75+
"editor.findMatchHighlightBackground": "#59b8b377",
76+
"editor.findMatchBorder": "#f39d12b6",
77+
"editor.hoverHighlightBackground": "#373941",
78+
"editor.lineHighlightBackground": "#2e323d",
79+
"editor.lineHighlightBorder": "#2e323d",
80+
"editorLink.activeForeground": "#3B79C7",
81+
"editor.rangeHighlightBackground": "#372F3C",
82+
"editorWhitespace.foreground": "#333844",
83+
"editorIndentGuide.background": "#333844",
84+
"editorIndentGuide.activeBackground": "#585C66",
85+
"editorRuler.foreground": "#4F4355",
86+
"editorCodeLens.foreground": "#746f77",
87+
"editorBracketMatch.background": "#746f77",
88+
"editorBracketMatch.border": "#746f77",
89+
"editorOverviewRuler.border": "#1B1D23",
90+
"editorError.foreground": "#FC644D",
91+
"editorWarning.foreground": "#FF9F2E",
92+
"editorGutter.modifiedBackground": "#5BC0EBBB",
93+
"editorGutter.addedBackground": "#9BC53DBB",
94+
"editorGutter.deletedBackground": "#FC644DBB",
95+
96+
"diffEditor.insertedTextBackground": "#29BF1220",
97+
"diffEditor.removedTextBackground": "#F21B3F20",
98+
99+
"editorWidget.background": "#20232A",
100+
"editorSuggestWidget.background": "#20232A",
101+
"editorSuggestWidget.border": "#372F3C",
102+
"editorSuggestWidget.selectedBackground": "#373941",
103+
"editorHoverWidget.background": "#373941",
104+
"editorHoverWidget.border": "#00e8c5cc",
105+
"debugExceptionWidget.background": "#FF9F2E60",
106+
"debugExceptionWidget.border": "#FF9F2E60",
107+
108+
"minimapSlider.background": "#58607460",
109+
"minimapSlider.hoverBackground": "#60698060",
110+
"minimapSlider.activeBackground": "#60698060",
111+
112+
"peekView.border": "#23262E",
113+
"peekViewEditor.background": "#1A1C22",
114+
"peekViewEditor.matchHighlightBackground": "#FF9F2E60",
115+
"peekViewResult.background": "#1A1C22",
116+
"peekViewResult.matchHighlightBackground": "#FF9F2E60",
117+
"peekViewResult.selectionBackground": "#23262E",
118+
"peekViewTitle.background": "#1A1C22",
119+
"peekViewTitleDescription.foreground": "#746f77",
120+
121+
"merge.currentHeaderBackground": "#F92672",
122+
"merge.currentContentBackground": "#F9267240",
123+
"merge.incomingHeaderBackground": "#3B79C7BB",
124+
"merge.incomingContentBackground": "#3B79C740",
125+
126+
"panel.background": "#23262E",
127+
"panel.border": "#1B1D23",
128+
"panelTitle.activeBorder": "#23262E",
129+
"panelTitle.inactiveForeground": "#746f77",
130+
131+
"statusBar.background": "#23262E",
132+
"statusBar.debuggingBackground": "#FC644D",
133+
"statusBar.noFolderBackground": "#23262E",
134+
"statusBarItem.activeBackground": "#00e8c5cc",
135+
"statusBarItem.hoverBackground": "#07d4b5b0",
136+
"statusBarItem.prominentBackground": "#07d4b5b0",
137+
"statusBarItem.prominentHoverBackground": "#00e8c5cc",
138+
139+
"terminal.ansiRed": "#ee5d43",
140+
"terminal.ansiGreen": "#96E072",
141+
"terminal.ansiYellow": "#FFE66D",
142+
"terminal.ansiBlue": "#7cb7ff",
143+
"terminal.ansiMagenta": "#ff00aa",
144+
"terminal.ansiCyan": "#00e8c6",
145+
"terminal.ansiBrightRed": "#ee5d43",
146+
"terminal.ansiBrightGreen": "#96E072",
147+
"terminal.ansiBrightYellow": "#FFE66D",
148+
"terminal.ansiBrightBlue": "#7cb7ff",
149+
"terminal.ansiBrightMagenta": "#ff00aa",
150+
"terminal.ansiBrightCyan": "#00e8c6",
151+
"terminalCursor.background": "#23262E",
152+
"terminalCursor.foreground": "#FFE66D",
153+
154+
"titleBar.activeBackground": "#23262E",
155+
156+
"notification.background": "#2d313b",
157+
"notification.buttonBackground": "#00e8c5cc",
158+
"notification.buttonHoverBackground": "#07d4b5b0",
159+
"notification.infoBackground": "#00b0ff",
160+
"notification.warningBackground": "#FF9F2E",
161+
"notification.errorBackground": "#FC644D",
162+
163+
"extensionButton.prominentBackground": "#07d4b6cc",
164+
"extensionButton.prominentHoverBackground": "#07d4b5b0",
165+
166+
"pickerGroup.border": "#4F4355",
167+
"pickerGroup.foreground": "#746f77",
168+
169+
"debugToolBar.background": "#20232A",
170+
171+
"walkThrough.embeddedEditorBackground": "#23262E",
172+
173+
"gitDecoration.ignoredResourceForeground": "#555555"
174+
},
175+
"tokenColors": [
176+
{
177+
"settings": {
178+
"foreground": "#D5CED9",
179+
"background": "#23262E"
180+
}
181+
},
182+
{
183+
"name": "Comment color",
184+
"scope": ["comment", "markup.quote.markdown", "meta.diff", "meta.diff.header"],
185+
"settings": {
186+
"foreground": "#A0A1A7cc"
187+
}
188+
},
189+
{
190+
"name": "Text Color",
191+
"scope": [
192+
"meta.template.expression.js",
193+
"constant.name.attribute.tag.jade",
194+
"punctuation.definition.metadata.markdown",
195+
"punctuation.definition.string.end.markdown",
196+
"punctuation.definition.string.begin.markdown"
197+
],
198+
"settings": {
199+
"foreground": "#D5CED9"
200+
}
201+
},
202+
{
203+
"name": "Cyan",
204+
"scope": [
205+
"variable",
206+
"support.variable",
207+
"entity.name.tag.yaml",
208+
"constant.character.entity.html",
209+
"source.css entity.name.tag.reference",
210+
"beginning.punctuation.definition.list.markdown",
211+
"source.css entity.other.attribute-name.parent-selector",
212+
"meta.structure.dictionary.json support.type.property-name"
213+
],
214+
"settings": {
215+
"foreground": "#00e8c6"
216+
}
217+
},
218+
{
219+
"name": "Orange",
220+
"scope": [
221+
"markup.bold",
222+
"constant.numeric",
223+
"meta.group.regexp",
224+
"constant.other.php",
225+
"support.constant.ext.php",
226+
"constant.other.class.php",
227+
"support.constant.core.php",
228+
"fenced_code.block.language",
229+
"constant.other.caps.python",
230+
"entity.other.attribute-name",
231+
"support.type.exception.python",
232+
"source.css keyword.other.unit",
233+
"variable.other.object.property.js.jsx",
234+
"variable.other.object.js"
235+
],
236+
"settings": {
237+
"foreground": "#f39c12"
238+
}
239+
},
240+
{
241+
"name": "Yellow",
242+
"scope": [
243+
"markup.list",
244+
"text.xml string",
245+
"entity.name.type",
246+
"support.function",
247+
"entity.other.attribute-name",
248+
"meta.at-rule.extend",
249+
"entity.name.function",
250+
"entity.other.inherited-class",
251+
"entity.other.keyframe-offset.css",
252+
"text.html.markdown string.quoted",
253+
"meta.function-call.generic.python",
254+
"meta.at-rule.extend support.constant",
255+
"entity.other.attribute-name.class.jade",
256+
"source.css entity.other.attribute-name",
257+
"text.xml punctuation.definition.string"
258+
],
259+
"settings": {
260+
"foreground": "#FFE66D"
261+
}
262+
},
263+
{
264+
"name": "Pink",
265+
"scope": ["markup.heading", "variable.language.this.js", "variable.language.special.self.python"],
266+
"settings": {
267+
"foreground": "#ff00aa"
268+
}
269+
},
270+
{
271+
"name": "Hot Pink",
272+
"scope": [
273+
"punctuation.definition.interpolation",
274+
"punctuation.section.embedded.end.php",
275+
"punctuation.section.embedded.end.ruby",
276+
"punctuation.section.embedded.begin.php",
277+
"punctuation.section.embedded.begin.ruby",
278+
"punctuation.definition.template-expression",
279+
"entity.name.tag"
280+
],
281+
"settings": {
282+
"foreground": "#f92672"
283+
}
284+
},
285+
{
286+
"name": "Purple",
287+
"scope": ["storage", "keyword", "meta.link", "meta.image", "markup.italic", "source.js support.type"],
288+
"settings": {
289+
"foreground": "#c74ded"
290+
}
291+
},
292+
{
293+
"name": "Blue",
294+
"scope": ["string.regexp", "markup.changed"],
295+
"settings": {
296+
"foreground": "#7cb7ff"
297+
}
298+
},
299+
{
300+
"name": "Red",
301+
"scope": [
302+
"constant",
303+
"support.class",
304+
"keyword.operator",
305+
"support.constant",
306+
"text.html.markdown string",
307+
"source.css support.function",
308+
"source.php support.function",
309+
"support.function.magic.python",
310+
"entity.other.attribute-name.id",
311+
"markup.deleted"
312+
],
313+
"settings": {
314+
"foreground": "#ee5d43"
315+
}
316+
},
317+
{
318+
"name": "Green",
319+
"scope": [
320+
"string",
321+
"text.html.php string",
322+
"markup.inline.raw",
323+
"markup.inserted",
324+
"punctuation.definition.string",
325+
"punctuation.definition.markdown",
326+
"text.html meta.embedded source.js string",
327+
"text.html.php punctuation.definition.string",
328+
"text.html meta.embedded source.js punctuation.definition.string",
329+
"text.html punctuation.definition.string",
330+
"text.html string"
331+
],
332+
"settings": {
333+
"foreground": "#96E072"
334+
}
335+
},
336+
{
337+
"name": "Font Underline",
338+
"scope": ["entity.other.inherited-class"],
339+
"settings": {
340+
"fontStyle": "underline"
341+
}
342+
}
343+
]
344+
}

‎themes/_scripts/main.mjs

+6-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function format(data = {}, dark = false) {
1616
const conf = {
1717
// name: data.name,
1818
// Layout
19-
background: colors['editor.background'],
19+
background: colors['activeBackground'] || colors['editor.background'],
2020
foreground: colors['editor.foreground'] || colors['input.foreground'],
2121
selection: colors['editor.wordHighlightBackground'] || colors['editor.selectionBackground'],
2222
selectionMatch: colors['editor.wordHighlightStrongBackground'] || colors['editor.selectionBackground'],
@@ -145,8 +145,9 @@ const getString = (obj) => `export const config = ${JSON.stringify(obj, null, 2)
145145
await FS.writeFile(themePath, getString(tomorrowNightBlue));
146146
console.log(`🎉 File \x1b[32;1m${themePath}\x1b[0m created.`);
147147

148-
// const themeSolarizedDark = format(require('./data/solarized.dark.json'), true)
149-
// console.log('~~~::', themeSolarizedDark);
150-
// const themeSolarizedLight = format(require('./data/solarized.light.json'))
151-
// console.log('~~~::', themeSolarizedLight);
148+
const andromeda = format(require('./data/andromeda.json'));
149+
themePath = '../andromeda/src/color.ts';
150+
await FS.writeFile(themePath, getString(andromeda));
151+
console.log(`🎉 File \x1b[32;1m${themePath}\x1b[0m created.`);
152+
152153
})()

‎themes/all/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ export * from '@uiw/codemirror-theme-xcode';
109109
<img width="436" alt="codemirror-theme-androidstudio" src="https://user-images.githubusercontent.com/1680273/177484354-0a4fa43e-de96-409f-83e2-61808f2347e6.png">
110110
</a>
111111

112+
### andromeda
113+
114+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/andromeda">
115+
<img width="436" alt="codemirror-theme-andromeda" src="https://github.com/uiwjs/react-codemirror/assets/1680273/8dabf62f-6258-4d42-8768-113c9f089c79">
116+
</a>
117+
112118
### atom one
113119

114120
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/xcode/light">

‎themes/all/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"@uiw/codemirror-theme-abcdef": "4.21.11",
2525
"@uiw/codemirror-theme-abyss": "4.21.11",
2626
"@uiw/codemirror-theme-androidstudio": "4.21.11",
27+
"@uiw/codemirror-theme-andromeda": "4.21.11",
2728
"@uiw/codemirror-theme-atomone": "4.21.11",
2829
"@uiw/codemirror-theme-aura": "4.21.11",
2930
"@uiw/codemirror-theme-basic": "4.21.11",

‎themes/andromeda/README.md

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<!--rehype:ignore:start-->
2+
3+
# Andromeda Theme
4+
5+
<!--rehype:ignore:end-->
6+
7+
[![npm version](https://img.shields.io/npm/v/@uiw/codemirror-theme-abyss.svg)](https://www.npmjs.com/package/@uiw/codemirror-theme-andromeda)
8+
9+
Andromeda theme for cm6, generated from [vscode themes](https://github.com/EliverLara/Andromeda/blob/master/themes/Andromeda-color-theme.json).
10+
11+
<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/andromeda">
12+
<img width="436" alt="codemirror-theme-andromeda" src="https://github.com/uiwjs/react-codemirror/assets/1680273/8dabf62f-6258-4d42-8768-113c9f089c79">
13+
</a>
14+
15+
## Install
16+
17+
```bash
18+
npm install @uiw/codemirror-theme-andromeda --save
19+
```
20+
21+
```jsx
22+
import { andromeda, andromedaInit } from '@uiw/codemirror-theme-andromeda';
23+
24+
<CodeMirror theme={andromeda} />
25+
<CodeMirror
26+
theme={andromedaInit({
27+
settings: {
28+
caret: '#c6c6c6',
29+
fontFamily: 'monospace',
30+
}
31+
})}
32+
/>
33+
```
34+
35+
## API
36+
37+
```tsx
38+
import { CreateThemeOptions } from '@uiw/codemirror-themes';
39+
export declare const defaultSettingsQuietlight: CreateThemeOptions['settings'];
40+
export declare const andromedaInit: (options?: Partial<CreateThemeOptions>) => import('@codemirror/state').Extension;
41+
export declare const andromeda: import('@codemirror/state').Extension;
42+
```
43+
44+
## Usage
45+
46+
```jsx
47+
import CodeMirror from '@uiw/react-codemirror';
48+
import { andromeda } from '@uiw/codemirror-theme-andromeda';
49+
import { javascript } from '@codemirror/lang-javascript';
50+
51+
function App() {
52+
return (
53+
<CodeMirror
54+
value="console.log('hello world!');"
55+
height="200px"
56+
theme={andromeda}
57+
extensions={[javascript({ jsx: true })]}
58+
onChange={(value, viewUpdate) => {
59+
console.log('value:', value);
60+
}}
61+
/>
62+
);
63+
}
64+
export default App;
65+
```
66+
67+
```js
68+
import { EditorView } from '@codemirror/view';
69+
import { EditorState } from '@codemirror/state';
70+
import { javascript } from '@codemirror/lang-javascript';
71+
import { andromeda } from '@uiw/codemirror-theme-andromeda';
72+
73+
const state = EditorState.create({
74+
doc: 'my source code',
75+
extensions: [andromeda, javascript({ jsx: true })],
76+
});
77+
78+
const view = new EditorView({
79+
parent: document.querySelector('#editor'),
80+
state,
81+
});
82+
```
83+
84+
## Contributors
85+
86+
As always, thanks to our amazing contributors!
87+
88+
<a href="https://github.com/uiwjs/react-codemirror/graphs/contributors">
89+
<img src="https://uiwjs.github.io/react-codemirror/CONTRIBUTORS.svg" />
90+
</a>
91+
92+
Made with [github-action-contributors](https://github.com/jaywcjlove/github-action-contributors).
93+
94+
## License
95+
96+
Licensed under the MIT License.

‎themes/andromeda/package.json

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "@uiw/codemirror-theme-andromeda",
3+
"version": "4.21.11",
4+
"description": "Theme andromeda for CodeMirror.",
5+
"homepage": "https://uiwjs.github.io/react-codemirror/#/theme/data/andromeda",
6+
"author": "kenny wong <wowohoo@qq.com>",
7+
"license": "MIT",
8+
"main": "./cjs/index.js",
9+
"module": "./esm/index.js",
10+
"scripts": {
11+
"watch": "tsbb watch src/*.ts --use-babel",
12+
"build": "tsbb build src/*.ts --use-babel"
13+
},
14+
"repository": {
15+
"type": "git",
16+
"url": "https://github.com/uiwjs/react-codemirror.git"
17+
},
18+
"files": [
19+
"src",
20+
"esm",
21+
"cjs"
22+
],
23+
"dependencies": {
24+
"@uiw/codemirror-themes": "4.21.11"
25+
},
26+
"keywords": [
27+
"codemirror",
28+
"codemirror-theme",
29+
"codemirror6",
30+
"theme",
31+
"andromeda",
32+
"syntax",
33+
"ide",
34+
"code"
35+
]
36+
}

‎themes/andromeda/src/color.ts

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
export const config = {
2+
background: '#23262E',
3+
foreground: '#D5CED9',
4+
selection: '#4F4355',
5+
selectionMatch: '#db45a280',
6+
cursor: '#FFF',
7+
dropdownBackground: '#2b303b',
8+
dropdownBorder: '#363c49',
9+
activeLine: '#2e323d',
10+
matchingBracket: '#746f77',
11+
keyword: '#c74ded',
12+
storage: '#c74ded',
13+
variable: '#00e8c6',
14+
parameter: '#00e8c6',
15+
function: '#FFE66D',
16+
string: '#96E072',
17+
constant: '#ee5d43',
18+
type: '#FFE66D',
19+
class: '#FFE66D',
20+
number: '#ee5d43',
21+
comment: '#A0A1A7cc',
22+
heading: '#ff00aa',
23+
invalid: null,
24+
regexp: '#96E072',
25+
tag: '#f92672',
26+
};

‎themes/andromeda/src/index.ts

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import { tags as t } from '@lezer/highlight';
2+
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
3+
import { config as c } from './color';
4+
5+
export const defaultSettingsAndromeda: CreateThemeOptions['settings'] = {
6+
background: c.background,
7+
foreground: c.foreground,
8+
caret: c.cursor,
9+
selection: c.selection,
10+
selectionMatch: c.selectionMatch,
11+
gutterBackground: c.background,
12+
gutterForeground: c.foreground,
13+
lineHighlight: c.activeLine,
14+
};
15+
16+
export const andromedaInit = (options?: Partial<CreateThemeOptions>) => {
17+
const { theme = 'dark', settings = {}, styles = [] } = options || {};
18+
return createTheme({
19+
theme: theme,
20+
settings: {
21+
...defaultSettingsAndromeda,
22+
...settings,
23+
},
24+
styles: [
25+
{ tag: t.keyword, color: c.keyword },
26+
{ tag: [t.name, t.deleted, t.character, t.macroName], color: c.variable },
27+
{ tag: [t.propertyName], color: c.function },
28+
{ tag: [t.processingInstruction, t.string, t.inserted, t.special(t.string)], color: c.string },
29+
{ tag: [t.function(t.variableName), t.labelName], color: c.function },
30+
{ tag: [t.color, t.constant(t.name), t.standard(t.name)], color: c.constant },
31+
{ tag: [t.definition(t.name), t.separator], color: c.variable },
32+
{ tag: [t.className], color: c.class },
33+
{ tag: [t.number, t.changed, t.annotation, t.modifier, t.self, t.namespace], color: c.number },
34+
{ tag: [t.typeName], color: c.type, fontStyle: c.type },
35+
{ tag: [t.operator], color: c.keyword },
36+
{ tag: [t.url, t.escape, t.regexp, t.link], color: c.regexp },
37+
{ tag: [t.meta, t.comment], color: c.comment },
38+
{ tag: t.tagName, color: c.tag },
39+
{ tag: t.strong, fontWeight: 'bold' },
40+
{ tag: t.emphasis, fontStyle: 'italic' },
41+
{ tag: t.link, textDecoration: 'underline' },
42+
{ tag: t.heading, fontWeight: 'bold', color: c.heading },
43+
{ tag: [t.atom, t.special(t.variableName)], color: c.variable },
44+
{ tag: t.invalid, color: c.invalid },
45+
{ tag: t.strikethrough, textDecoration: 'line-through' },
46+
{
47+
tag: [t.operatorKeyword, t.bool, t.null, t.variableName],
48+
color: c.constant,
49+
},
50+
...styles,
51+
],
52+
});
53+
};
54+
55+
export const andromeda = andromedaInit();

‎themes/andromeda/tsconfig.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "../../tsconfig",
3+
"include": ["src"],
4+
"compilerOptions": {
5+
"outDir": "./cjs",
6+
"baseUrl": ".",
7+
"noEmit": false
8+
}
9+
}

‎www/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"@uiw/codemirror-theme-abcdef": "4.21.11",
4848
"@uiw/codemirror-theme-abyss": "4.21.11",
4949
"@uiw/codemirror-theme-androidstudio": "4.21.11",
50+
"@uiw/codemirror-theme-andromeda": "4.21.11",
5051
"@uiw/codemirror-theme-atomone": "4.21.11",
5152
"@uiw/codemirror-theme-aura": "4.21.11",
5253
"@uiw/codemirror-theme-basic": "4.21.11",

‎www/src/pages/theme/themes/Datas.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { abcdef } from '@uiw/codemirror-theme-abcdef';
22
import { abyss } from '@uiw/codemirror-theme-abyss';
33
import { androidstudio } from '@uiw/codemirror-theme-androidstudio';
4+
import { andromeda } from '@uiw/codemirror-theme-andromeda';
45
import { atomone } from '@uiw/codemirror-theme-atomone';
56
import { aura } from '@uiw/codemirror-theme-aura';
67
import { basicLight, basicDark } from '@uiw/codemirror-theme-basic';
@@ -34,6 +35,7 @@ export const themeData = {
3435
abcdef,
3536
abyss,
3637
androidstudio,
38+
andromeda,
3739
atomone,
3840
aura,
3941
basicLight,

‎www/src/router.tsx

+10
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,16 @@ export const routes: MenuRouteObject[] = [
217217
/>
218218
),
219219
},
220+
{
221+
path: 'data/andromeda',
222+
label: 'Andromeda',
223+
element: (
224+
<Preview
225+
themePkg="@uiw/codemirror-theme-andromeda"
226+
path={() => import('@uiw/codemirror-theme-andromeda/README.md')}
227+
/>
228+
),
229+
},
220230
{
221231
path: 'data/atomone',
222232
label: 'Atomone',

0 commit comments

Comments
 (0)
Please sign in to comment.