Skip to content

Commit 3e7707d

Browse files
committedFeb 10, 2023
feat: export theme default settings. (#457)
1 parent 1b94f57 commit 3e7707d

File tree

25 files changed

+360
-240
lines changed

25 files changed

+360
-240
lines changed
 

‎themes/abcdef/src/index.ts

+12-8
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,23 @@
66
import { tags as t } from '@lezer/highlight';
77
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
88

9+
export const defaultSettingsAbcdef: CreateThemeOptions['settings'] = {
10+
background: '#0f0f0f',
11+
foreground: '#defdef',
12+
caret: '#00FF00',
13+
selection: '#515151',
14+
selectionMatch: '#515151',
15+
gutterBackground: '#555',
16+
gutterForeground: '#FFFFFF',
17+
lineHighlight: '#314151',
18+
};
19+
920
export const abcdefInit = (options?: Partial<CreateThemeOptions>) => {
1021
const { theme = 'dark', settings = {}, styles = [] } = options || {};
1122
return createTheme({
1223
theme: theme,
1324
settings: {
14-
background: '#0f0f0f',
15-
foreground: '#defdef',
16-
caret: '#00FF00',
17-
selection: '#515151',
18-
selectionMatch: '#515151',
19-
gutterBackground: '#555',
20-
gutterForeground: '#FFFFFF',
21-
lineHighlight: '#314151',
25+
...defaultSettingsAbcdef,
2226
...settings,
2327
},
2428
styles: [

‎themes/androidstudio/src/index.ts

+10-6
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,21 @@
44
import { tags as t } from '@lezer/highlight';
55
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
66

7+
export const defaultSettingsAndroidstudio: CreateThemeOptions['settings'] = {
8+
background: '#282b2e',
9+
foreground: '#a9b7c6',
10+
caret: '#00FF00',
11+
selection: '#343739',
12+
selectionMatch: '#343739',
13+
lineHighlight: '#343739',
14+
};
15+
716
export const androidstudioInit = (options?: Partial<CreateThemeOptions>) => {
817
const { theme = 'dark', settings = {}, styles = [] } = options || {};
918
return createTheme({
1019
theme: theme,
1120
settings: {
12-
background: '#282b2e',
13-
foreground: '#a9b7c6',
14-
caret: '#00FF00',
15-
selection: '#343739',
16-
selectionMatch: '#343739',
17-
lineHighlight: '#343739',
21+
...defaultSettingsAndroidstudio,
1822
...settings,
1923
},
2024
styles: [

‎themes/atomone/src/index.ts

+13-9
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,24 @@
77
import { tags as t } from '@lezer/highlight';
88
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
99

10+
export const defaultSettingsAtomone: CreateThemeOptions['settings'] = {
11+
background: '#272C35',
12+
foreground: '#9d9b97',
13+
caret: '#797977',
14+
selection: '#ffffff30',
15+
selectionMatch: '#2B323D',
16+
gutterBackground: '#272C35',
17+
gutterForeground: '#465063',
18+
gutterBorder: 'transparent',
19+
lineHighlight: '#2B323D',
20+
};
21+
1022
export const atomoneInit = (options?: Partial<CreateThemeOptions>) => {
1123
const { theme = 'light', settings = {}, styles = [] } = options || {};
1224
return createTheme({
1325
theme: theme,
1426
settings: {
15-
background: '#272C35',
16-
foreground: '#9d9b97',
17-
caret: '#797977',
18-
selection: '#ffffff30',
19-
selectionMatch: '#2B323D',
20-
gutterBackground: '#272C35',
21-
gutterForeground: '#465063',
22-
gutterBorder: 'transparent',
23-
lineHighlight: '#2B323D',
27+
...defaultSettingsAtomone,
2428
...settings,
2529
},
2630
styles: [

‎themes/aura/src/index.ts

+13-9
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
import { tags as t } from '@lezer/highlight';
22
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
33

4+
export const defaultSettingsAura: CreateThemeOptions['settings'] = {
5+
background: '#21202e',
6+
foreground: '#edecee',
7+
caret: '#a277ff',
8+
selection: '#3d375e7f',
9+
selectionMatch: '#3d375e7f',
10+
gutterBackground: '#21202e',
11+
gutterForeground: '#edecee',
12+
gutterBorder: 'transparent',
13+
lineHighlight: '#a394f033',
14+
};
15+
416
export const auraInit = (options?: Partial<CreateThemeOptions>) => {
517
const { theme = 'dark', settings = {}, styles = [] } = options || {};
618
return createTheme({
719
theme: theme,
820
settings: {
9-
background: '#21202e',
10-
foreground: '#edecee',
11-
caret: '#a277ff',
12-
selection: '#3d375e7f',
13-
selectionMatch: '#3d375e7f',
14-
gutterBackground: '#21202e',
15-
gutterForeground: '#edecee',
16-
gutterBorder: 'transparent',
17-
lineHighlight: '#a394f033',
21+
...defaultSettingsAura,
1822
...settings,
1923
},
2024
styles: [

‎themes/bbedit/src/index.ts

+13-9
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
import { tags as t } from '@lezer/highlight';
22
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
33

4+
export const defaultSettingsBbedit: CreateThemeOptions['settings'] = {
5+
background: '#FFFFFF',
6+
foreground: '#000000',
7+
caret: '#FBAC52',
8+
selection: '#FFD420',
9+
selectionMatch: '#FFD420',
10+
gutterBackground: '#f5f5f5',
11+
gutterForeground: '#4D4D4C',
12+
gutterBorder: 'transparent',
13+
lineHighlight: '#00000012',
14+
};
15+
416
export const bbeditInit = (options?: Partial<CreateThemeOptions>) => {
517
const { theme = 'light', settings = {}, styles = [] } = options || {};
618
return createTheme({
719
theme: theme,
820
settings: {
9-
background: '#FFFFFF',
10-
foreground: '#000000',
11-
caret: '#FBAC52',
12-
selection: '#FFD420',
13-
selectionMatch: '#FFD420',
14-
gutterBackground: '#f5f5f5',
15-
gutterForeground: '#4D4D4C',
16-
gutterBorder: 'transparent',
17-
lineHighlight: '#00000012',
21+
...defaultSettingsBbedit,
1822
...settings,
1923
},
2024
styles: [

‎themes/bespin/src/index.ts

+12-8
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,23 @@
88
import { tags as t } from '@lezer/highlight';
99
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
1010

11+
export const defaultSettingsBespin: CreateThemeOptions['settings'] = {
12+
background: '#28211c',
13+
foreground: '#9d9b97',
14+
caret: '#797977',
15+
selection: '#36312e',
16+
selectionMatch: '#4f382b',
17+
gutterBackground: '#28211c',
18+
gutterForeground: '#666666',
19+
lineHighlight: 'rgba(255, 255, 255, 0.1)',
20+
};
21+
1122
export const bespinInit = (options?: Partial<CreateThemeOptions>) => {
1223
const { theme = 'dark', settings = {}, styles = [] } = options || {};
1324
return createTheme({
1425
theme: theme,
1526
settings: {
16-
background: '#28211c',
17-
foreground: '#9d9b97',
18-
caret: '#797977',
19-
selection: '#36312e',
20-
selectionMatch: '#4f382b',
21-
gutterBackground: '#28211c',
22-
gutterForeground: '#666666',
23-
lineHighlight: 'rgba(255, 255, 255, 0.1)',
27+
...defaultSettingsBespin,
2428
...settings,
2529
},
2630
styles: [

‎themes/darcula/src/index.ts

+13-9
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,24 @@
77
import { tags as t } from '@lezer/highlight';
88
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
99

10+
export const defaultSettingsDarcula: CreateThemeOptions['settings'] = {
11+
background: '#2B2B2B',
12+
foreground: '#f8f8f2',
13+
caret: '#FFFFFF',
14+
selection: 'rgba(255, 255, 255, 0.1)',
15+
selectionMatch: 'rgba(255, 255, 255, 0.2)',
16+
gutterBackground: 'rgba(255, 255, 255, 0.1)',
17+
gutterForeground: '#999',
18+
gutterBorder: 'transparent',
19+
lineHighlight: 'rgba(255, 255, 255, 0.1)',
20+
};
21+
1022
export const darculaInit = (options?: Partial<CreateThemeOptions>) => {
1123
const { theme = 'light', settings = {}, styles = [] } = options || {};
1224
return createTheme({
1325
theme: theme,
1426
settings: {
15-
background: '#2B2B2B',
16-
foreground: '#f8f8f2',
17-
caret: '#FFFFFF',
18-
selection: 'rgba(255, 255, 255, 0.1)',
19-
selectionMatch: 'rgba(255, 255, 255, 0.2)',
20-
gutterBackground: 'rgba(255, 255, 255, 0.1)',
21-
gutterForeground: '#999',
22-
gutterBorder: 'transparent',
23-
lineHighlight: 'rgba(255, 255, 255, 0.1)',
27+
...defaultSettingsDarcula,
2428
...settings,
2529
},
2630
styles: [

‎themes/dracula/src/index.ts

+13-9
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,24 @@
77
import { tags as t } from '@lezer/highlight';
88
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
99

10+
export const defaultSettingsDracula: CreateThemeOptions['settings'] = {
11+
background: '#282a36',
12+
foreground: '#f8f8f2',
13+
caret: '#f8f8f0',
14+
selection: 'rgba(255, 255, 255, 0.1)',
15+
selectionMatch: 'rgba(255, 255, 255, 0.2)',
16+
gutterBackground: '#282a36',
17+
gutterForeground: '#6D8A88',
18+
gutterBorder: 'transparent',
19+
lineHighlight: 'rgba(255, 255, 255, 0.1)',
20+
};
21+
1022
export const draculaInit = (options?: Partial<CreateThemeOptions>) => {
1123
const { theme = 'light', settings = {}, styles = [] } = options || {};
1224
return createTheme({
1325
theme: theme,
1426
settings: {
15-
background: '#282a36',
16-
foreground: '#f8f8f2',
17-
caret: '#f8f8f0',
18-
selection: 'rgba(255, 255, 255, 0.1)',
19-
selectionMatch: 'rgba(255, 255, 255, 0.2)',
20-
gutterBackground: '#282a36',
21-
gutterForeground: '#6D8A88',
22-
gutterBorder: 'transparent',
23-
lineHighlight: 'rgba(255, 255, 255, 0.1)',
27+
...defaultSettingsDracula,
2428
...settings,
2529
},
2630
styles: [

‎themes/duotone/src/index.ts

+24-16
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,24 @@
66
import { tags as t } from '@lezer/highlight';
77
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
88

9+
export const defaultSettingsDuotoneLight: CreateThemeOptions['settings'] = {
10+
background: '#faf8f5',
11+
foreground: '#b29762',
12+
caret: '#93abdc',
13+
selection: '#e3dcce',
14+
selectionMatch: '#e3dcce',
15+
gutterBackground: '#faf8f5',
16+
gutterForeground: '#cdc4b1',
17+
gutterBorder: 'transparent',
18+
lineHighlight: '#EFEFEF',
19+
};
20+
921
export const duotoneLightInit = (options?: Partial<CreateThemeOptions>) => {
1022
const { theme = 'light', settings = {}, styles = [] } = options || {};
1123
return createTheme({
1224
theme: theme,
1325
settings: {
14-
background: '#faf8f5',
15-
foreground: '#b29762',
16-
caret: '#93abdc',
17-
selection: '#e3dcce',
18-
selectionMatch: '#e3dcce',
19-
gutterBackground: '#faf8f5',
20-
gutterForeground: '#cdc4b1',
21-
gutterBorder: 'transparent',
22-
lineHighlight: '#EFEFEF',
26+
...defaultSettingsDuotoneLight,
2327
...settings,
2428
},
2529
styles: [
@@ -37,18 +41,22 @@ export const duotoneLightInit = (options?: Partial<CreateThemeOptions>) => {
3741

3842
export const duotoneLight = duotoneLightInit();
3943

44+
export const defaultSettingsDuotoneDark: CreateThemeOptions['settings'] = {
45+
background: '#2a2734',
46+
foreground: '#6c6783',
47+
caret: '#ffad5c',
48+
selection: 'rgba(255, 255, 255, 0.1)',
49+
gutterBackground: '#2a2734',
50+
gutterForeground: '#545167',
51+
lineHighlight: '#36334280',
52+
};
53+
4054
export const duotoneDarkInit = (options?: Partial<CreateThemeOptions>) => {
4155
const { theme = 'light', settings = {}, styles = [] } = options || {};
4256
return createTheme({
4357
theme: theme,
4458
settings: {
45-
background: '#2a2734',
46-
foreground: '#6c6783',
47-
caret: '#ffad5c',
48-
selection: 'rgba(255, 255, 255, 0.1)',
49-
gutterBackground: '#2a2734',
50-
gutterForeground: '#545167',
51-
lineHighlight: '#36334280',
59+
...defaultSettingsDuotoneDark,
5260
...settings,
5361
},
5462
styles: [

‎themes/eclipse/src/index.ts

+13-9
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
import { tags as t } from '@lezer/highlight';
22
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
33

4+
export const defaultSettingsEclipse: CreateThemeOptions['settings'] = {
5+
background: '#fff',
6+
foreground: '#000',
7+
caret: '#FFFFFF',
8+
selection: '#d7d4f0',
9+
selectionMatch: '#d7d4f0',
10+
gutterBackground: '#f7f7f7',
11+
gutterForeground: '#999',
12+
lineHighlight: '#e8f2ff',
13+
gutterBorder: 'transparent',
14+
};
15+
416
export const eclipseInit = (options?: Partial<CreateThemeOptions>) => {
517
const { theme = 'light', settings = {}, styles = [] } = options || {};
618
return createTheme({
719
theme: theme,
820
settings: {
9-
background: '#fff',
10-
foreground: '#000',
11-
caret: '#FFFFFF',
12-
selection: '#d7d4f0',
13-
selectionMatch: '#d7d4f0',
14-
gutterBackground: '#f7f7f7',
15-
gutterForeground: '#999',
16-
lineHighlight: '#e8f2ff',
17-
gutterBorder: 'transparent',
21+
...defaultSettingsEclipse,
1822
...settings,
1923
},
2024
styles: [

‎themes/github/src/index.ts

+20-12
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,21 @@
44
import { tags as t } from '@lezer/highlight';
55
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
66

7+
export const defaultSettingsGithubLight: CreateThemeOptions['settings'] = {
8+
background: '#fff',
9+
foreground: '#24292e',
10+
selection: '#BBDFFF',
11+
selectionMatch: '#BBDFFF',
12+
gutterBackground: '#fff',
13+
gutterForeground: '#6e7781',
14+
};
15+
716
export const githubLightInit = (options?: Partial<CreateThemeOptions>) => {
817
const { theme = 'light', settings = {}, styles = [] } = options || {};
918
return createTheme({
1019
theme: theme,
1120
settings: {
12-
background: '#fff',
13-
foreground: '#24292e',
14-
selection: '#BBDFFF',
15-
selectionMatch: '#BBDFFF',
16-
gutterBackground: '#fff',
17-
gutterForeground: '#6e7781',
21+
...defaultSettingsGithubLight,
1822
...settings,
1923
},
2024
styles: [
@@ -40,17 +44,21 @@ export const githubLightInit = (options?: Partial<CreateThemeOptions>) => {
4044

4145
export const githubLight = githubLightInit();
4246

47+
export const defaultSettingsGithubDark: CreateThemeOptions['settings'] = {
48+
background: '#0d1117',
49+
foreground: '#c9d1d9',
50+
caret: '#c9d1d9',
51+
selection: '#003d73',
52+
selectionMatch: '#003d73',
53+
lineHighlight: '#36334280',
54+
};
55+
4356
export const githubDarkInit = (options?: Partial<CreateThemeOptions>) => {
4457
const { theme = 'dark', settings = {}, styles = [] } = options || {};
4558
return createTheme({
4659
theme: theme,
4760
settings: {
48-
background: '#0d1117',
49-
foreground: '#c9d1d9',
50-
caret: '#c9d1d9',
51-
selection: '#003d73',
52-
selectionMatch: '#003d73',
53-
lineHighlight: '#36334280',
61+
...defaultSettingsGithubDark,
5462
...settings,
5563
},
5664
styles: [

‎themes/gruvbox/src/index.ts

+25-17
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,23 @@
77
import { tags as t } from '@lezer/highlight';
88
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
99

10+
export const defaultSettingsGruvboxDark: CreateThemeOptions['settings'] = {
11+
background: '#282828',
12+
foreground: '#ebdbb2',
13+
caret: '#ebdbb2',
14+
selection: '#bdae93',
15+
selectionMatch: '#bdae93',
16+
lineHighlight: '#3c3836',
17+
gutterBackground: '#282828',
18+
gutterForeground: '#7c6f64',
19+
};
20+
1021
export const gruvboxDarkInit = (options?: Partial<CreateThemeOptions>) => {
1122
const { theme = 'dark', settings = {}, styles = [] } = options || {};
1223
return createTheme({
1324
theme: theme,
1425
settings: {
15-
background: '#282828',
16-
foreground: '#ebdbb2',
17-
caret: '#ebdbb2',
18-
selection: '#bdae93',
19-
selectionMatch: '#bdae93',
20-
lineHighlight: '#3c3836',
21-
gutterBackground: '#282828',
22-
gutterForeground: '#7c6f64',
26+
...defaultSettingsGruvboxDark,
2327
...settings,
2428
},
2529
styles: [
@@ -122,20 +126,24 @@ export const gruvboxDarkInit = (options?: Partial<CreateThemeOptions>) => {
122126

123127
export const gruvboxDark = gruvboxDarkInit();
124128

129+
export const defaultSettingsGruvboxLight: CreateThemeOptions['settings'] = {
130+
background: '#fbf1c7',
131+
foreground: '#3c3836',
132+
caret: '#af3a03',
133+
selection: '#ebdbb2',
134+
selectionMatch: '#bdae93',
135+
lineHighlight: '#ebdbb2',
136+
gutterBackground: '#ebdbb2',
137+
gutterForeground: '#665c54',
138+
gutterBorder: 'transparent',
139+
};
140+
125141
export const gruvboxLightInit = (options?: Partial<CreateThemeOptions>) => {
126142
const { theme = 'dark', settings = {}, styles = [] } = options || {};
127143
return createTheme({
128144
theme: theme,
129145
settings: {
130-
background: '#fbf1c7',
131-
foreground: '#3c3836',
132-
caret: '#af3a03',
133-
selection: '#ebdbb2',
134-
selectionMatch: '#bdae93',
135-
lineHighlight: '#ebdbb2',
136-
gutterBackground: '#ebdbb2',
137-
gutterForeground: '#665c54',
138-
gutterBorder: 'transparent',
146+
...defaultSettingsGruvboxLight,
139147
...settings,
140148
},
141149
styles: [

‎themes/material/src/index.ts

+28-18
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
import { tags as t } from '@lezer/highlight';
22
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
33

4+
export const defaultSettingsMaterial: CreateThemeOptions['settings'] = {
5+
background: '#2e3235',
6+
foreground: '#bdbdbd',
7+
caret: '#a0a4ae',
8+
selection: '#d7d4f0',
9+
selectionMatch: '#d7d4f0',
10+
gutterBackground: '#2e3235',
11+
gutterForeground: '#999',
12+
gutterActiveForeground: '#4f5b66',
13+
lineHighlight: '#545b61',
14+
};
15+
16+
export const defaultSettingsMaterialDark = defaultSettingsMaterial;
17+
418
export const materialInit = (options?: Partial<CreateThemeOptions>) => {
519
const { theme = 'dark', settings = {}, styles = [] } = options || {};
620
return createTheme({
721
theme: theme,
822
settings: {
9-
background: '#2e3235',
10-
foreground: '#bdbdbd',
11-
caret: '#a0a4ae',
12-
selection: '#d7d4f0',
13-
selectionMatch: '#d7d4f0',
14-
gutterBackground: '#2e3235',
15-
gutterForeground: '#999',
16-
gutterActiveForeground: '#4f5b66',
17-
lineHighlight: '#545b61',
23+
...defaultSettingsMaterial,
1824
...settings,
1925
},
2026
styles: [
@@ -120,20 +126,24 @@ export const materialDarkInit = materialInit;
120126
export const materialDark = materialInit();
121127
export const material = materialInit();
122128

129+
export const defaultSettingsMaterialLight: CreateThemeOptions['settings'] = {
130+
background: '#FAFAFA',
131+
foreground: '#90A4AE',
132+
caret: '#272727',
133+
selection: '#80CBC440',
134+
selectionMatch: '#FAFAFA',
135+
gutterBackground: '#FAFAFA',
136+
gutterForeground: '#90A4AE',
137+
gutterBorder: 'transparent',
138+
lineHighlight: '#CCD7DA50',
139+
};
140+
123141
export const materialLightInit = (options?: Partial<CreateThemeOptions>) => {
124142
const { theme = 'light', settings = {}, styles = [] } = options || {};
125143
return createTheme({
126144
theme: theme,
127145
settings: {
128-
background: '#FAFAFA',
129-
foreground: '#90A4AE',
130-
caret: '#272727',
131-
selection: '#80CBC440',
132-
selectionMatch: '#FAFAFA',
133-
gutterBackground: '#FAFAFA',
134-
gutterForeground: '#90A4AE',
135-
gutterBorder: 'transparent',
136-
lineHighlight: '#CCD7DA50',
146+
...defaultSettingsMaterialLight,
137147
...settings,
138148
},
139149
styles: [

‎themes/noctis-lilac/src/index.ts

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
import { tags as t } from '@lezer/highlight';
22
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
33

4+
export const defaultSettingsNoctisLilac: CreateThemeOptions['settings'] = {
5+
background: '#f2f1f8',
6+
foreground: '#0c006b',
7+
caret: '#5c49e9',
8+
selection: '#d5d1f2',
9+
selectionMatch: '#d5d1f2',
10+
gutterBackground: '#f2f1f8',
11+
gutterForeground: '#0c006b70',
12+
lineHighlight: '#e1def3',
13+
};
14+
415
export const noctisLilacInit = (options?: Partial<CreateThemeOptions>) => {
516
const { theme = 'light', settings = {}, styles = [] } = options || {};
617
return createTheme({
718
theme: theme,
819
settings: {
9-
background: '#f2f1f8',
10-
foreground: '#0c006b',
11-
caret: '#5c49e9',
12-
selection: '#d5d1f2',
13-
selectionMatch: '#d5d1f2',
14-
gutterBackground: '#f2f1f8',
15-
gutterForeground: '#0c006b70',
16-
lineHighlight: '#e1def3',
20+
...defaultSettingsNoctisLilac,
1721
...settings,
1822
},
1923
styles: [

‎themes/nord/src/index.ts

+13-9
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
import { tags as t } from '@lezer/highlight';
22
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
33

4+
export const defaultSettingsNord: CreateThemeOptions['settings'] = {
5+
background: '#2e3440',
6+
foreground: '#FFFFFF',
7+
caret: '#FFFFFF',
8+
selection: '#3b4252',
9+
selectionMatch: '#e5e9f0',
10+
gutterBackground: '#2e3440',
11+
gutterForeground: '#4c566a',
12+
gutterActiveForeground: '#d8dee9',
13+
lineHighlight: '#4c566a',
14+
};
15+
416
// Colors from https://www.nordtheme.com/docs/colors-and-palettes
517
export const nordInit = (options?: Partial<CreateThemeOptions>) => {
618
const { theme = 'dark', settings = {}, styles = [] } = options || {};
719
return createTheme({
820
theme: theme,
921
settings: {
10-
background: '#2e3440',
11-
foreground: '#FFFFFF',
12-
caret: '#FFFFFF',
13-
selection: '#3b4252',
14-
selectionMatch: '#e5e9f0',
15-
gutterBackground: '#2e3440',
16-
gutterForeground: '#4c566a',
17-
gutterActiveForeground: '#d8dee9',
18-
lineHighlight: '#4c566a',
22+
...defaultSettingsNord,
1923
...settings,
2024
},
2125
styles: [

‎themes/okaidia/src/index.ts

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
import { tags as t } from '@lezer/highlight';
22
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
33

4+
export const defaultSettingsOkaidia: CreateThemeOptions['settings'] = {
5+
background: '#272822',
6+
foreground: '#FFFFFF',
7+
caret: '#FFFFFF',
8+
selection: '#49483E',
9+
selectionMatch: '#49483E',
10+
gutterBackground: '#272822',
11+
gutterForeground: '#FFFFFF70',
12+
lineHighlight: '#00000059',
13+
};
14+
415
export const okaidiaInit = (options?: Partial<CreateThemeOptions>) => {
516
const { theme = 'dark', settings = {}, styles = [] } = options || {};
617
return createTheme({
718
theme: theme,
819
settings: {
9-
background: '#272822',
10-
foreground: '#FFFFFF',
11-
caret: '#FFFFFF',
12-
selection: '#49483E',
13-
selectionMatch: '#49483E',
14-
gutterBackground: '#272822',
15-
gutterForeground: '#FFFFFF70',
16-
lineHighlight: '#00000059',
20+
...defaultSettingsOkaidia,
1721
...settings,
1822
},
1923
styles: [

‎themes/solarized/src/index.ts

+24-16
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
import { tags as t } from '@lezer/highlight';
22
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
33

4+
export const defaultSettingsSolarizedLight: CreateThemeOptions['settings'] = {
5+
background: '#fdf6e3',
6+
foreground: '#657b83',
7+
caret: '#586e75',
8+
selection: '#dfd9c8',
9+
selectionMatch: '#dfd9c8',
10+
gutterBackground: '#00000010',
11+
gutterForeground: '#657b83',
12+
lineHighlight: '#dfd9c8',
13+
};
14+
415
export const solarizedLightInit = (options?: Partial<CreateThemeOptions>) => {
516
const { theme = 'light', settings = {}, styles = [] } = options || {};
617
return createTheme({
718
theme: theme,
819
settings: {
9-
background: '#fdf6e3',
10-
foreground: '#657b83',
11-
caret: '#586e75',
12-
selection: '#dfd9c8',
13-
selectionMatch: '#dfd9c8',
14-
gutterBackground: '#00000010',
15-
gutterForeground: '#657b83',
16-
lineHighlight: '#dfd9c8',
20+
...defaultSettingsSolarizedLight,
1721
...settings,
1822
},
1923
styles: [
@@ -115,19 +119,23 @@ export const solarizedLightInit = (options?: Partial<CreateThemeOptions>) => {
115119

116120
export const solarizedLight = solarizedLightInit();
117121

122+
export const defaultSettingsSolarizedDark: CreateThemeOptions['settings'] = {
123+
background: '#002b36',
124+
foreground: '#93a1a1',
125+
caret: '#839496',
126+
selection: '#173541',
127+
selectionMatch: '#aafe661a',
128+
gutterBackground: '#00252f',
129+
gutterForeground: '#839496',
130+
lineHighlight: '#173541',
131+
};
132+
118133
export const solarizedDarkInit = (options?: Partial<CreateThemeOptions>) => {
119134
const { theme = 'dark', settings = {}, styles = [] } = options || {};
120135
return createTheme({
121136
theme: theme,
122137
settings: {
123-
background: '#002b36',
124-
foreground: '#93a1a1',
125-
caret: '#839496',
126-
selection: '#173541',
127-
selectionMatch: '#aafe661a',
128-
gutterBackground: '#00252f',
129-
gutterForeground: '#839496',
130-
lineHighlight: '#173541',
138+
...defaultSettingsSolarizedDark,
131139
...settings,
132140
},
133141
styles: [

‎themes/sublime/src/index.ts

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
import { tags as t } from '@lezer/highlight';
22
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
33

4+
export const defaultSettingsSublime: CreateThemeOptions['settings'] = {
5+
background: '#303841',
6+
foreground: '#FFFFFF',
7+
caret: '#FBAC52',
8+
selection: '#4C5964',
9+
selectionMatch: '#3A546E',
10+
gutterBackground: '#303841',
11+
gutterForeground: '#FFFFFF70',
12+
lineHighlight: '#00000059',
13+
};
14+
415
export function sublimeInit(options?: Partial<CreateThemeOptions>) {
516
const { theme = 'dark', settings = {}, styles = [] } = options || {};
617
return createTheme({
718
theme: theme,
819
settings: {
9-
background: '#303841',
10-
foreground: '#FFFFFF',
11-
caret: '#FBAC52',
12-
selection: '#4C5964',
13-
selectionMatch: '#3A546E',
14-
gutterBackground: '#303841',
15-
gutterForeground: '#FFFFFF70',
16-
lineHighlight: '#00000059',
20+
...defaultSettingsSublime,
1721
...settings,
1822
},
1923
styles: [

‎themes/tokyo-night-day/src/index.ts

+13-9
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
import { tags as t } from '@lezer/highlight';
22
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
33

4+
export const defaultSettingsTokyoNightDay: CreateThemeOptions['settings'] = {
5+
background: '#e1e2e7',
6+
foreground: '#3760bf',
7+
caret: '#3760bf',
8+
selection: '#99a7df',
9+
selectionMatch: '#99a7df',
10+
gutterBackground: '#e1e2e7',
11+
gutterForeground: '#3760bf',
12+
gutterBorder: 'transparent',
13+
lineHighlight: '#5f5faf11',
14+
};
15+
416
export const tokyoNightDayInit = (options?: Partial<CreateThemeOptions>) => {
517
const { theme = 'light', settings = {}, styles = [] } = options || {};
618
return createTheme({
719
theme: theme,
820
settings: {
9-
background: '#e1e2e7',
10-
foreground: '#3760bf',
11-
caret: '#3760bf',
12-
selection: '#99a7df',
13-
selectionMatch: '#99a7df',
14-
gutterBackground: '#e1e2e7',
15-
gutterForeground: '#3760bf',
16-
gutterBorder: 'transparent',
17-
lineHighlight: '#5f5faf11',
21+
...defaultSettingsTokyoNightDay,
1822
...settings,
1923
},
2024
styles: [

‎themes/tokyo-night-storm/src/index.ts

+13-9
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
import { tags as t } from '@lezer/highlight';
22
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
33

4+
export const defaultSettingsTokyoNightStorm: CreateThemeOptions['settings'] = {
5+
background: '#24283b',
6+
foreground: '#7982a9',
7+
caret: '#c0caf5',
8+
selection: '#6f7bb630',
9+
selectionMatch: '#1f2335',
10+
gutterBackground: '#24283b',
11+
gutterForeground: '#7982a9',
12+
gutterBorder: 'transparent',
13+
lineHighlight: '#292e42',
14+
};
15+
416
export const tokyoNightStormInit = (options?: Partial<CreateThemeOptions>) => {
517
const { theme = 'dark', settings = {}, styles = [] } = options || {};
618
return createTheme({
719
theme: theme,
820
settings: {
9-
background: '#24283b',
10-
foreground: '#7982a9',
11-
caret: '#c0caf5',
12-
selection: '#6f7bb630',
13-
selectionMatch: '#1f2335',
14-
gutterBackground: '#24283b',
15-
gutterForeground: '#7982a9',
16-
gutterBorder: 'transparent',
17-
lineHighlight: '#292e42',
21+
...defaultSettingsTokyoNightStorm,
1822
...settings,
1923
},
2024
styles: [

‎themes/tokyo-night/src/index.ts

+13-9
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
import { tags as t } from '@lezer/highlight';
22
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
33

4+
export const defaultSettingsTokyoNight: CreateThemeOptions['settings'] = {
5+
background: '#1a1b26',
6+
foreground: '#787c99',
7+
caret: '#c0caf5',
8+
selection: '#515c7e40',
9+
selectionMatch: '#16161e',
10+
gutterBackground: '#1a1b26',
11+
gutterForeground: '#787c99',
12+
gutterBorder: 'transparent',
13+
lineHighlight: '#1e202e',
14+
};
15+
416
export const tokyoNightInit = (options?: Partial<CreateThemeOptions>) => {
517
const { theme = 'dark', settings = {}, styles = [] } = options || {};
618
return createTheme({
719
theme: theme,
820
settings: {
9-
background: '#1a1b26',
10-
foreground: '#787c99',
11-
caret: '#c0caf5',
12-
selection: '#515c7e40',
13-
selectionMatch: '#16161e',
14-
gutterBackground: '#1a1b26',
15-
gutterForeground: '#787c99',
16-
gutterBorder: 'transparent',
17-
lineHighlight: '#1e202e',
21+
...defaultSettingsTokyoNight,
1822
...settings,
1923
},
2024
styles: [

‎themes/vscode/src/index.ts

+14-10
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,25 @@
44
import { tags as t } from '@lezer/highlight';
55
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
66

7+
export const defaultSettingsVscodeDark: CreateThemeOptions['settings'] = {
8+
background: '#1e1e1e',
9+
foreground: '#9cdcfe',
10+
caret: '#c6c6c6',
11+
selection: '#6199ff2f',
12+
selectionMatch: '#72a1ff59',
13+
lineHighlight: '#ffffff0f',
14+
gutterBackground: '#1e1e1e',
15+
gutterForeground: '#838383',
16+
gutterActiveForeground: '#fff',
17+
fontFamily: 'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace',
18+
};
19+
720
export function vscodeDarkInit(options?: Partial<CreateThemeOptions>) {
821
const { theme = 'dark', settings = {}, styles = [] } = options || {};
922
return createTheme({
1023
theme: theme,
1124
settings: {
12-
background: '#1e1e1e',
13-
foreground: '#9cdcfe',
14-
caret: '#c6c6c6',
15-
selection: '#6199ff2f',
16-
selectionMatch: '#72a1ff59',
17-
lineHighlight: '#ffffff0f',
18-
gutterBackground: '#1e1e1e',
19-
gutterForeground: '#838383',
20-
gutterActiveForeground: '#fff',
21-
fontFamily: 'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace',
25+
...defaultSettingsVscodeDark,
2226
...settings,
2327
},
2428
styles: [

‎themes/xcode/src/index.ts

+22-14
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
/**
2-
* @name github
2+
* @name Xcode
33
*/
44
import { tags as t } from '@lezer/highlight';
55
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
66

7+
export const defaultSettingsXcodeLight: CreateThemeOptions['settings'] = {
8+
background: '#fff',
9+
foreground: '#3D3D3D',
10+
selection: '#BBDFFF',
11+
selectionMatch: '#BBDFFF',
12+
gutterBackground: '#fff',
13+
gutterForeground: '#AFAFAF',
14+
lineHighlight: '#EDF4FF',
15+
};
16+
717
export function xcodeLightInit(options?: Partial<CreateThemeOptions>) {
818
const { theme = 'light', settings = {}, styles = [] } = options || {};
919
return createTheme({
1020
theme: theme,
1121
settings: {
12-
background: '#fff',
13-
foreground: '#3D3D3D',
14-
selection: '#BBDFFF',
15-
selectionMatch: '#BBDFFF',
16-
gutterBackground: '#fff',
17-
gutterForeground: '#AFAFAF',
18-
lineHighlight: '#EDF4FF',
22+
...defaultSettingsXcodeLight,
1923
...settings,
2024
},
2125
styles: [
@@ -35,17 +39,21 @@ export function xcodeLightInit(options?: Partial<CreateThemeOptions>) {
3539

3640
export const xcodeLight = xcodeLightInit();
3741

42+
export const defaultSettingsXcodeDark: CreateThemeOptions['settings'] = {
43+
background: '#292A30',
44+
foreground: '#CECFD0',
45+
caret: '#fff',
46+
selection: '#727377',
47+
selectionMatch: '#727377',
48+
lineHighlight: '#2F3239',
49+
};
50+
3851
export const xcodeDarkInit = (options?: Partial<CreateThemeOptions>) => {
3952
const { theme = 'dark', settings = {}, styles = [] } = options || {};
4053
return createTheme({
4154
theme: theme,
4255
settings: {
43-
background: '#292A30',
44-
foreground: '#CECFD0',
45-
caret: '#fff',
46-
selection: '#727377',
47-
selectionMatch: '#727377',
48-
lineHighlight: '#2F3239',
56+
...defaultSettingsXcodeDark,
4957
...settings,
5058
},
5159
styles: [

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

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export const ThemesAllDoc = () => {
1616
const themesData: Record<string, Omit<ReactCodeMirrorProps['theme'], 'dark' | 'light'>> = {};
1717
Object.keys(themes)
1818
.filter((item) => typeof themes[item as keyof typeof themes] !== 'function')
19+
.filter((item) => !/^(defaultSettings)/.test(item as keyof typeof themes))
1920
.forEach((item) => {
2021
themesData[item] = themes[item as keyof typeof themes];
2122
});

‎www/src/pages/home/Example.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import { useTheme } from '../../utils/useTheme';
1313

1414
const themeOptions = ['dark', 'light']
1515
.concat(Object.keys(alls))
16-
.filter((item) => typeof alls[item as keyof typeof alls] !== 'function');
16+
.filter((item) => typeof alls[item as keyof typeof alls] !== 'function')
17+
.filter((item) => !/^(defaultSettings)/.test(item as keyof typeof alls));
1718
const heightOptions = ['auto', '200px', '300px', '500px'];
1819
let count = 0;
1920

0 commit comments

Comments
 (0)
Please sign in to comment.