/
index.ts
39 lines (36 loc) · 1.28 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
* @name androidstudio
*/
import { tags as t } from '@lezer/highlight';
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
export const defaultSettingsAndroidstudio: CreateThemeOptions['settings'] = {
background: '#282b2e',
foreground: '#a9b7c6',
caret: '#00FF00',
selection: '#343739',
selectionMatch: '#343739',
lineHighlight: '#343739',
};
export const androidstudioInit = (options?: Partial<CreateThemeOptions>) => {
const { theme = 'dark', settings = {}, styles = [] } = options || {};
return createTheme({
theme: theme,
settings: {
...defaultSettingsAndroidstudio,
...settings,
},
styles: [
{ tag: [t.keyword, t.deleted, t.className], color: '#cc7832' },
{ tag: [t.number, t.literal, t.derefOperator], color: '#6897bb' },
{ tag: [t.link, t.variableName], color: '#629755' },
{ tag: [t.comment, t.quote], color: 'grey' },
{ tag: [t.meta, t.documentMeta], color: '#bbb529' },
{ tag: [t.string, t.propertyName, t.attributeValue], color: '#6a8759' },
{ tag: [t.heading, t.typeName], color: '#ffc66d' },
{ tag: [t.attributeName], color: '#a9b7c6' },
{ tag: [t.emphasis], fontStyle: 'italic' },
...styles,
],
});
};
export const androidstudio = androidstudioInit();