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