Skip to content

Commit f09f7be

Browse files
committed
feat: exports themes style. #670
1 parent ad0d999 commit f09f7be

File tree

39 files changed

+1115
-1398
lines changed

39 files changed

+1115
-1398
lines changed

themes/abcdef/src/index.ts

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* https://codemirror.net/5/theme/abcdef.css
55
*/
66
import { tags as t } from '@lezer/highlight';
7-
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
7+
import { createTheme, type CreateThemeOptions } from '@uiw/codemirror-themes';
88

99
export const defaultSettingsAbcdef: CreateThemeOptions['settings'] = {
1010
background: '#0f0f0f',
@@ -17,6 +17,26 @@ export const defaultSettingsAbcdef: CreateThemeOptions['settings'] = {
1717
lineHighlight: '#0a6bcb3d',
1818
};
1919

20+
export const abcdefDarkStyle: CreateThemeOptions['styles'] = [
21+
{ tag: t.keyword, color: 'darkgoldenrod', fontWeight: 'bold' },
22+
{ tag: t.atom, color: '#77F' },
23+
{ tag: t.comment, color: '#7a7b7c', fontStyle: 'italic' },
24+
{ tag: t.number, color: 'violet' },
25+
{ tag: t.definition(t.variableName), color: '#fffabc' },
26+
{ tag: t.variableName, color: '#abcdef' },
27+
{ tag: t.function(t.variableName), color: '#fffabc' },
28+
{ tag: t.typeName, color: '#FFDD44' },
29+
{ tag: t.tagName, color: '#def' },
30+
{ tag: t.string, color: '#2b4' },
31+
{ tag: t.meta, color: '#C9F' },
32+
// { tag: t.qualifier, color: '#FFF700' },
33+
// { tag: t.builtin, color: '#30aabc' },
34+
{ tag: t.bracket, color: '#8a8a8a' },
35+
{ tag: t.attributeName, color: '#DDFF00' },
36+
{ tag: t.heading, color: 'aquamarine', fontWeight: 'bold' },
37+
{ tag: t.link, color: 'blueviolet', fontWeight: 'bold' },
38+
];
39+
2040
export const abcdefInit = (options?: Partial<CreateThemeOptions>) => {
2141
const { theme = 'dark', settings = {}, styles = [] } = options || {};
2242
return createTheme({
@@ -25,26 +45,7 @@ export const abcdefInit = (options?: Partial<CreateThemeOptions>) => {
2545
...defaultSettingsAbcdef,
2646
...settings,
2747
},
28-
styles: [
29-
{ tag: t.keyword, color: 'darkgoldenrod', fontWeight: 'bold' },
30-
{ tag: t.atom, color: '#77F' },
31-
{ tag: t.comment, color: '#7a7b7c', fontStyle: 'italic' },
32-
{ tag: t.number, color: 'violet' },
33-
{ tag: t.definition(t.variableName), color: '#fffabc' },
34-
{ tag: t.variableName, color: '#abcdef' },
35-
{ tag: t.function(t.variableName), color: '#fffabc' },
36-
{ tag: t.typeName, color: '#FFDD44' },
37-
{ tag: t.tagName, color: '#def' },
38-
{ tag: t.string, color: '#2b4' },
39-
{ tag: t.meta, color: '#C9F' },
40-
// { tag: t.qualifier, color: '#FFF700' },
41-
// { tag: t.builtin, color: '#30aabc' },
42-
{ tag: t.bracket, color: '#8a8a8a' },
43-
{ tag: t.attributeName, color: '#DDFF00' },
44-
{ tag: t.heading, color: 'aquamarine', fontWeight: 'bold' },
45-
{ tag: t.link, color: 'blueviolet', fontWeight: 'bold' },
46-
...styles,
47-
],
48+
styles: [...abcdefDarkStyle, ...styles],
4849
});
4950
};
5051

themes/abyss/src/index.ts

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,30 @@ export const defaultSettingsAbyss: CreateThemeOptions['settings'] = {
1313
lineHighlight: c.activeLine,
1414
};
1515

16+
export const abyssDarkStyle: CreateThemeOptions['styles'] = [
17+
{ tag: t.keyword, color: c.keyword },
18+
{ tag: [t.name, t.deleted, t.character, t.macroName], color: c.variable },
19+
{ tag: [t.propertyName], color: c.function },
20+
{ tag: [t.processingInstruction, t.string, t.inserted, t.special(t.string)], color: c.string },
21+
{ tag: [t.function(t.variableName), t.labelName], color: c.function },
22+
{ tag: [t.color, t.constant(t.name), t.standard(t.name)], color: c.constant },
23+
{ tag: [t.definition(t.name), t.separator], color: c.variable },
24+
{ tag: [t.className], color: c.class },
25+
{ tag: [t.number, t.changed, t.annotation, t.modifier, t.self, t.namespace], color: c.number },
26+
{ tag: [t.typeName], color: c.type, fontStyle: c.type },
27+
{ tag: [t.operator, t.operatorKeyword], color: c.keyword },
28+
{ tag: [t.url, t.escape, t.regexp, t.link], color: c.regexp },
29+
{ tag: [t.meta, t.comment], color: c.comment },
30+
{ tag: t.tagName, color: c.tag },
31+
{ tag: t.strong, fontWeight: 'bold' },
32+
{ tag: t.emphasis, fontStyle: 'italic' },
33+
{ tag: t.link, textDecoration: 'underline' },
34+
{ tag: t.heading, fontWeight: 'bold', color: c.heading },
35+
{ tag: [t.atom, t.bool, t.special(t.variableName)], color: c.variable },
36+
{ tag: t.invalid, color: c.invalid },
37+
{ tag: t.strikethrough, textDecoration: 'line-through' },
38+
];
39+
1640
export const abyssInit = (options?: Partial<CreateThemeOptions>) => {
1741
const { theme = 'dark', settings = {}, styles = [] } = options || {};
1842
return createTheme({
@@ -21,30 +45,7 @@ export const abyssInit = (options?: Partial<CreateThemeOptions>) => {
2145
...defaultSettingsAbyss,
2246
...settings,
2347
},
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, t.operatorKeyword], 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.bool, t.special(t.variableName)], color: c.variable },
44-
{ tag: t.invalid, color: c.invalid },
45-
{ tag: t.strikethrough, textDecoration: 'line-through' },
46-
...styles,
47-
],
48+
styles: [...abyssDarkStyle, ...styles],
4849
});
4950
};
5051

themes/androidstudio/src/index.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @name androidstudio
33
*/
44
import { tags as t } from '@lezer/highlight';
5-
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
5+
import { createTheme, type CreateThemeOptions } from '@uiw/codemirror-themes';
66

77
export const defaultSettingsAndroidstudio: CreateThemeOptions['settings'] = {
88
background: '#282b2e',
@@ -13,6 +13,18 @@ export const defaultSettingsAndroidstudio: CreateThemeOptions['settings'] = {
1313
lineHighlight: '#7f85891f',
1414
};
1515

16+
export const androidstudioDarkStyle: CreateThemeOptions['styles'] = [
17+
{ tag: [t.keyword, t.deleted, t.className], color: '#cc7832' },
18+
{ tag: [t.number, t.literal, t.derefOperator], color: '#6897bb' },
19+
{ tag: [t.link, t.variableName], color: '#629755' },
20+
{ tag: [t.comment, t.quote], color: 'grey' },
21+
{ tag: [t.meta, t.documentMeta], color: '#bbb529' },
22+
{ tag: [t.string, t.propertyName, t.attributeValue], color: '#6a8759' },
23+
{ tag: [t.heading, t.typeName], color: '#ffc66d' },
24+
{ tag: [t.attributeName], color: '#a9b7c6' },
25+
{ tag: [t.emphasis], fontStyle: 'italic' },
26+
];
27+
1628
export const androidstudioInit = (options?: Partial<CreateThemeOptions>) => {
1729
const { theme = 'dark', settings = {}, styles = [] } = options || {};
1830
return createTheme({
@@ -21,18 +33,7 @@ export const androidstudioInit = (options?: Partial<CreateThemeOptions>) => {
2133
...defaultSettingsAndroidstudio,
2234
...settings,
2335
},
24-
styles: [
25-
{ tag: [t.keyword, t.deleted, t.className], color: '#cc7832' },
26-
{ tag: [t.number, t.literal, t.derefOperator], color: '#6897bb' },
27-
{ tag: [t.link, t.variableName], color: '#629755' },
28-
{ tag: [t.comment, t.quote], color: 'grey' },
29-
{ tag: [t.meta, t.documentMeta], color: '#bbb529' },
30-
{ tag: [t.string, t.propertyName, t.attributeValue], color: '#6a8759' },
31-
{ tag: [t.heading, t.typeName], color: '#ffc66d' },
32-
{ tag: [t.attributeName], color: '#a9b7c6' },
33-
{ tag: [t.emphasis], fontStyle: 'italic' },
34-
...styles,
35-
],
36+
styles: [...androidstudioDarkStyle, ...styles],
3637
});
3738
};
3839

themes/andromeda/src/index.ts

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { tags as t } from '@lezer/highlight';
2-
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
2+
import { createTheme, type CreateThemeOptions } from '@uiw/codemirror-themes';
33
import { config as c } from './color';
44

55
export const defaultSettingsAndromeda: CreateThemeOptions['settings'] = {
@@ -13,6 +13,34 @@ export const defaultSettingsAndromeda: CreateThemeOptions['settings'] = {
1313
lineHighlight: c.activeLine,
1414
};
1515

16+
export const andromedaDarkStyle: CreateThemeOptions['styles'] = [
17+
{ tag: t.keyword, color: c.keyword },
18+
{ tag: [t.name, t.deleted, t.character, t.macroName], color: c.variable },
19+
{ tag: [t.propertyName], color: c.function },
20+
{ tag: [t.processingInstruction, t.string, t.inserted, t.special(t.string)], color: c.string },
21+
{ tag: [t.function(t.variableName), t.labelName], color: c.function },
22+
{ tag: [t.color, t.constant(t.name), t.standard(t.name)], color: c.constant },
23+
{ tag: [t.definition(t.name), t.separator], color: c.variable },
24+
{ tag: [t.className], color: c.class },
25+
{ tag: [t.number, t.changed, t.annotation, t.modifier, t.self, t.namespace], color: c.number },
26+
{ tag: [t.typeName], color: c.type, fontStyle: c.type },
27+
{ tag: [t.operator], color: c.keyword },
28+
{ tag: [t.url, t.escape, t.regexp, t.link], color: c.regexp },
29+
{ tag: [t.meta, t.comment], color: c.comment },
30+
{ tag: t.tagName, color: c.tag },
31+
{ tag: t.strong, fontWeight: 'bold' },
32+
{ tag: t.emphasis, fontStyle: 'italic' },
33+
{ tag: t.link, textDecoration: 'underline' },
34+
{ tag: t.heading, fontWeight: 'bold', color: c.heading },
35+
{ tag: [t.atom, t.special(t.variableName)], color: c.variable },
36+
{ tag: t.invalid, color: c.invalid },
37+
{ tag: t.strikethrough, textDecoration: 'line-through' },
38+
{
39+
tag: [t.operatorKeyword, t.bool, t.null, t.variableName],
40+
color: c.constant,
41+
},
42+
];
43+
1644
export const andromedaInit = (options?: Partial<CreateThemeOptions>) => {
1745
const { theme = 'dark', settings = {}, styles = [] } = options || {};
1846
return createTheme({
@@ -21,34 +49,7 @@ export const andromedaInit = (options?: Partial<CreateThemeOptions>) => {
2149
...defaultSettingsAndromeda,
2250
...settings,
2351
},
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+
styles: [...andromedaDarkStyle, ...styles],
5253
});
5354
};
5455

themes/atomone/src/index.ts

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,20 @@ export const defaultSettingsAtomone: CreateThemeOptions['settings'] = {
1919
lineHighlight: '#2e3f5940',
2020
};
2121

22+
export const atomoneDarkStyle: CreateThemeOptions['styles'] = [
23+
{
24+
tag: [t.function(t.variableName), t.function(t.propertyName), t.url, t.processingInstruction],
25+
color: 'hsl(207, 82%, 66%)',
26+
},
27+
{ tag: [t.tagName, t.heading], color: '#e06c75' },
28+
{ tag: t.comment, color: '#54636D' },
29+
{ tag: [t.propertyName], color: 'hsl(220, 14%, 71%)' },
30+
{ tag: [t.attributeName, t.number], color: 'hsl( 29, 54%, 61%)' },
31+
{ tag: t.className, color: 'hsl( 39, 67%, 69%)' },
32+
{ tag: t.keyword, color: 'hsl(286, 60%, 67%)' },
33+
{ tag: [t.string, t.regexp, t.special(t.propertyName)], color: '#98c379' },
34+
];
35+
2236
export const atomoneInit = (options?: Partial<CreateThemeOptions>) => {
2337
const { theme = 'dark', settings = {}, styles = [] } = options || {};
2438
return createTheme({
@@ -27,20 +41,7 @@ export const atomoneInit = (options?: Partial<CreateThemeOptions>) => {
2741
...defaultSettingsAtomone,
2842
...settings,
2943
},
30-
styles: [
31-
{
32-
tag: [t.function(t.variableName), t.function(t.propertyName), t.url, t.processingInstruction],
33-
color: 'hsl(207, 82%, 66%)',
34-
},
35-
{ tag: [t.tagName, t.heading], color: '#e06c75' },
36-
{ tag: t.comment, color: '#54636D' },
37-
{ tag: [t.propertyName], color: 'hsl(220, 14%, 71%)' },
38-
{ tag: [t.attributeName, t.number], color: 'hsl( 29, 54%, 61%)' },
39-
{ tag: t.className, color: 'hsl( 39, 67%, 69%)' },
40-
{ tag: t.keyword, color: 'hsl(286, 60%, 67%)' },
41-
{ tag: [t.string, t.regexp, t.special(t.propertyName)], color: '#98c379' },
42-
...styles,
43-
],
44+
styles: [...atomoneDarkStyle, ...styles],
4445
});
4546
};
4647

themes/aura/src/index.ts

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { tags as t } from '@lezer/highlight';
2-
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
2+
import { createTheme, type CreateThemeOptions } from '@uiw/codemirror-themes';
33

44
export const defaultSettingsAura: CreateThemeOptions['settings'] = {
55
background: '#21202e',
@@ -13,6 +13,29 @@ export const defaultSettingsAura: CreateThemeOptions['settings'] = {
1313
lineHighlight: '#a394f033',
1414
};
1515

16+
export const auraDarkStyle: CreateThemeOptions['styles'] = [
17+
{ tag: t.keyword, color: '#a277ff' },
18+
{ tag: [t.name, t.deleted, t.character, t.macroName], color: '#edecee' },
19+
{ tag: [t.propertyName], color: '#ffca85' },
20+
{ tag: [t.processingInstruction, t.string, t.inserted, t.special(t.string)], color: '#61ffca' },
21+
{ tag: [t.function(t.variableName), t.labelName], color: '#ffca85' },
22+
{ tag: [t.color, t.constant(t.name), t.standard(t.name)], color: '#61ffca' },
23+
{ tag: [t.definition(t.name), t.separator], color: '#edecee' },
24+
{ tag: [t.className], color: '#82e2ff' },
25+
{ tag: [t.number, t.changed, t.annotation, t.modifier, t.self, t.namespace], color: '#61ffca' },
26+
{ tag: [t.typeName], color: '#82e2ff' },
27+
{ tag: [t.operator, t.operatorKeyword], color: '#a277ff' },
28+
{ tag: [t.url, t.escape, t.regexp, t.link], color: '#61ffca' },
29+
{ tag: [t.meta, t.comment], color: '#6d6d6d' },
30+
{ tag: t.strong, fontWeight: 'bold' },
31+
{ tag: t.emphasis, fontStyle: 'italic' },
32+
{ tag: t.link, textDecoration: 'underline' },
33+
{ tag: t.heading, fontWeight: 'bold', color: '#a277ff' },
34+
{ tag: [t.atom, t.bool, t.special(t.variableName)], color: '#edecee' },
35+
{ tag: t.invalid, color: '#ff6767' },
36+
{ tag: t.strikethrough, textDecoration: 'line-through' },
37+
];
38+
1639
export const auraInit = (options?: Partial<CreateThemeOptions>) => {
1740
const { theme = 'dark', settings = {}, styles = [] } = options || {};
1841
return createTheme({
@@ -21,29 +44,7 @@ export const auraInit = (options?: Partial<CreateThemeOptions>) => {
2144
...defaultSettingsAura,
2245
...settings,
2346
},
24-
styles: [
25-
{ tag: t.keyword, color: '#a277ff' },
26-
{ tag: [t.name, t.deleted, t.character, t.macroName], color: '#edecee' },
27-
{ tag: [t.propertyName], color: '#ffca85' },
28-
{ tag: [t.processingInstruction, t.string, t.inserted, t.special(t.string)], color: '#61ffca' },
29-
{ tag: [t.function(t.variableName), t.labelName], color: '#ffca85' },
30-
{ tag: [t.color, t.constant(t.name), t.standard(t.name)], color: '#61ffca' },
31-
{ tag: [t.definition(t.name), t.separator], color: '#edecee' },
32-
{ tag: [t.className], color: '#82e2ff' },
33-
{ tag: [t.number, t.changed, t.annotation, t.modifier, t.self, t.namespace], color: '#61ffca' },
34-
{ tag: [t.typeName], color: '#82e2ff' },
35-
{ tag: [t.operator, t.operatorKeyword], color: '#a277ff' },
36-
{ tag: [t.url, t.escape, t.regexp, t.link], color: '#61ffca' },
37-
{ tag: [t.meta, t.comment], color: '#6d6d6d' },
38-
{ tag: t.strong, fontWeight: 'bold' },
39-
{ tag: t.emphasis, fontStyle: 'italic' },
40-
{ tag: t.link, textDecoration: 'underline' },
41-
{ tag: t.heading, fontWeight: 'bold', color: '#a277ff' },
42-
{ tag: [t.atom, t.bool, t.special(t.variableName)], color: '#edecee' },
43-
{ tag: t.invalid, color: '#ff6767' },
44-
{ tag: t.strikethrough, textDecoration: 'line-through' },
45-
...styles,
46-
],
47+
styles: [...auraDarkStyle, ...styles],
4748
});
4849
};
4950

0 commit comments

Comments
 (0)