-
Notifications
You must be signed in to change notification settings - Fork 12
/
Subtheme.ts
212 lines (193 loc) · 4.58 KB
/
Subtheme.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
export default interface Subtheme {
readonly name: string;
apply(mode: SubthemeModeType): void;
reset(mode: SubthemeModeType): void;
}
export const SUBTHEME_VARS = [
'--sidebar-bg-color',
'--sidebar-border-color',
'--sidebar-heading-text-color',
'--sidebar-heading-link-color',
'--sidebar-toc-h1-link-color',
'--sidebar-toc-h1-border-color',
'--sidebar-toc-h2-link-color',
'--sidebar-active-toc-section-bg-color',
'--sidebar-active-toc-section-link-color',
'--sidebar-active-toc-h1-section-link-color',
'--sidebar-active-toc-h2-section-link-color',
'--sidebar-toc-section-link-color',
'--main-heading-text-color',
'--main-heading-link-color',
'--main-link-color',
'--hoverable-link-hover-color',
'--main-bg-color',
'--main-text-color',
'--main-table-pre-bg-color',
'--main-table-pre-text-color',
'--main-table-pre-border',
'--main-tt-text-color',
'--main-tt-bg-color',
'--main-tt-border',
'--main-blockquote-text-color',
'--main-header-border-bottom-color',
];
export interface SubthemeVarsType {
[css_var: string]: string;
rouge_theme: string;
}
export interface SubthemeDefinitionType {
light: SubthemeVarsType;
dark: SubthemeVarsType;
}
export type SubthemeModeType = 'light' | 'dark';
export interface RougeTheme {
readonly name: string;
apply(): void;
reset(): void;
}
export interface RougeStyle {
color?: string;
'background-color'?: string;
'font-style'?: string;
'font-weight'?: string;
}
export interface RougeVarsType {
cm: RougeStyle; // Comment::Multiline
cp: RougeStyle; // Comment::Preproc
c1: RougeStyle; // Comment::Single
cs: RougeStyle; // Comment::Special
cd: RougeStyle; // Comment
c: RougeStyle; // Comment
err: RougeStyle; // Error
gd: RougeStyle; // Generic::Deleted
ge: RougeStyle; // Generic::Emph
gr: RougeStyle; // Generic::Error
gh: RougeStyle; // Generic::Heading
gi: RougeStyle; // Generic::Inserted
go: RougeStyle; // Generic::Output
gp: RougeStyle; // Generic::Prompt
gs: RougeStyle; // Generic::Strong
gu: RougeStyle; // Generic::Subheading
gt: RougeStyle; // Generic::Traceback
kc: RougeStyle; // Keyword::Constant
kd: RougeStyle; // Keyword::Declaration
kn: RougeStyle; // Keyword::Namespace
kp: RougeStyle; // Keyword::Pseudo
kr: RougeStyle; // Keyword::Reserved
kt: RougeStyle; // Keyword::Type
kv: RougeStyle; // Keyword
k: RougeStyle; // Keyword
mf: RougeStyle; // Literal::Number::Float
mh: RougeStyle; // Literal::Number::Hex
il: RougeStyle; // Literal::Number::Integer::Long
mi: RougeStyle; // Literal::Number::Integer
mo: RougeStyle; // Literal::Number::Oct
mb: RougeStyle; // Literal::Number
mx: RougeStyle; // Literal::Number
m: RougeStyle; // Literal::Number
sb: RougeStyle; // Literal::String::Backtick
sc: RougeStyle; // Literal::String::Char
sd: RougeStyle; // Literal::String::Symbol
s2: RougeStyle; // Literal::String::Double
se: RougeStyle; // Literal::String::Escape
sh: RougeStyle; // Literal::String::Heredoc
si: RougeStyle; // Literal::String::Interpol
sx: RougeStyle; // Literal::String::Other
sr: RougeStyle; // Literal::String::Regex
s1: RougeStyle; // Literal::String::Single
ss: RougeStyle; // Literal::String::Symbol
s: RougeStyle; // Literal::String
na: RougeStyle; // Name::Attribute
bp: RougeStyle; // Name::Builtin::Pseudo
nb: RougeStyle; // Name::Builtin
nc: RougeStyle; // Name::Class
no: RougeStyle; // Name::Constant
nd: RougeStyle; // Name::Decorator
ni: RougeStyle; // Name::Entity
ne: RougeStyle; // Name::Exception
nf: RougeStyle; // Name::Function
nl: RougeStyle; // Name::Label
nn: RougeStyle; // Name::Namespace
nt: RougeStyle; // Name::Tag
vc: RougeStyle; // Name::Variable::Class
vg: RougeStyle; // Name::Variable::Global
vi: RougeStyle; // Name::Variable::Instance
nv: RougeStyle; // Name::Variable
ow: RougeStyle; // Operator::Word
o: RougeStyle; // Operator
w: RougeStyle; // Text::Whitespace
txt: RougeStyle; // Text
}
export const ROUGE_STYLE_PROPS = [
'color',
'background-color',
'font-style',
'font-weight',
];
export const ROUGE_CLASS_NAMES = [
'cm',
'cp',
'c1',
'cs',
'cd',
'c',
'err',
'gd',
'ge',
'gr',
'gh',
'gi',
'go',
'gp',
'gs',
'gu',
'gt',
'kc',
'kd',
'kn',
'kp',
'kr',
'kt',
'kv',
'k',
'mf',
'mh',
'il',
'mi',
'mo',
'mb',
'mx',
'm',
'sb',
'sc',
'sd',
's2',
'se',
'sh',
'si',
'sx',
'sr',
's1',
'ss',
's',
'na',
'bp',
'nb',
'nc',
'no',
'nd',
'ni',
'ne',
'nf',
'nl',
'nn',
'nt',
'vc',
'vg',
'vi',
'nv',
'ow',
'o',
'w',
'txt',
];