-
Notifications
You must be signed in to change notification settings - Fork 131
/
index.ts
92 lines (91 loc) · 2.94 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import { tags as t } from '@lezer/highlight'
import { createTheme } from '@uiw/codemirror-themes'
export const customTheme = createTheme({
theme: 'light',
settings: {
background: 'var(--theme-background-2, var(--default-theme-background-2))',
foreground: 'var(--theme-color-1, var(--default-theme-color-1))',
caret: 'var(--theme-color-1, var(--default-theme-color-1))',
// Selection likely needs a hardcoded color due to it not accepting variables
selection: 'rgba(151, 183, 205, 0.2)',
selectionMatch: '#e3dcce',
gutterBackground:
'var(--theme-background-2, var(--default-theme-background-2))',
gutterForeground: 'var(--theme-color-3, var(--default-theme-color-3))',
gutterBorder: 'transparent',
lineHighlight:
'var(--theme-background-3, var(--default-theme-background-3))',
fontFamily: 'var(--theme-font-code, var(--default-theme-font-code))',
},
styles: [
{
tag: [t.standard(t.tagName), t.tagName],
color: 'var(--theme-color-purple, var(--default-theme-color-purple))',
},
{
tag: [t.comment],
color: 'var(--theme-color-3, var(--default-theme-color-3))',
},
{
tag: [t.className],
color: 'var(--theme-color-orange, var(--default-theme-color-orange))',
},
{
tag: [t.variableName, t.propertyName, t.attributeName],
color: 'var(--theme-color-1, var(--default-theme-color-1))',
},
{
tag: [t.operator],
color: 'var(--theme-color-2, var(--default-theme-color-2))',
},
{
tag: [t.keyword, t.typeName, t.typeOperator],
color: 'var(--theme-color-green, var(--default-theme-color-green))',
},
{
tag: [t.string],
color: 'var(--theme-color-blue, var(--default-theme-color-blue))',
},
{
tag: [t.bracket, t.regexp, t.meta],
color: 'var(--theme-color-3, var(--default-theme-color-3))',
},
{
tag: [t.number],
color: 'var(--theme-color-blue, var(--default-theme-color-blue))',
},
{
tag: [t.name, t.quote],
color: 'var(--theme-color-3, var(--default-theme-color-3))',
},
{
tag: [t.heading],
color: 'var(--theme-color-3, var(--default-theme-color-3))',
fontWeight: 'bold',
},
{
tag: [t.emphasis],
color: 'var(--theme-color-3, var(--default-theme-color-3))',
fontStyle: 'italic',
},
{
tag: [t.deleted],
color: 'var(--theme-color-3, var(--default-theme-color-3))',
backgroundColor: 'transparent',
},
{
tag: [t.atom, t.bool, t.special(t.variableName)],
color: 'var(--theme-color-3, var(--default-theme-color-3))',
},
{
tag: [t.url, t.escape, t.regexp, t.link],
color: 'var(--theme-color-1, var(--default-theme-color-1))',
},
{ tag: t.link, textDecoration: 'underline' },
{ tag: t.strikethrough, textDecoration: 'line-through' },
{
tag: t.invalid,
color: 'var(--theme-color-3, var(--default-theme-color-3))',
},
],
})