@fsegurai/codemirror-theme-github-light 6.2.7 → 6.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +40 -32
  2. package/dist/index.cjs +652 -382
  3. package/dist/index.js +652 -382
  4. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -10,9 +10,6 @@ const generalContent = {
10
10
  fontFamily: 'JetBrains Mono, Consolas, monospace',
11
11
  lineHeight: '1.6',
12
12
  };
13
- const generalCursor = {
14
- borderLeftWidth: '2px',
15
- };
16
13
  const generalDiff = {
17
14
  insertedTextDecoration: 'none',
18
15
  deletedTextDecoration: 'line-through',
@@ -22,11 +19,9 @@ const generalGutter = {
22
19
  border: 'none',
23
20
  paddingRight: '8px',
24
21
  fontSize: '0.9em',
25
- fontWeight: '500',
26
22
  lineHeight: '1.78', // Adjusted to compensate for 0.9em fontSize (1.6 / 0.9 ≈ 1.78)
27
23
  };
28
24
  const generalPanel = {
29
- border: 'none',
30
25
  borderRadius: '4px',
31
26
  padding: '2px 10px',
32
27
  };
@@ -106,6 +101,498 @@ function applyMergeRevertStyles(styles) {
106
101
  document.head.appendChild(styleEl);
107
102
  }
108
103
 
104
+ // Shared theme core: every theme package describes a palette (`ThemeDefinition`) and this module turns it into the
105
+ // CodeMirror extension. Generated into each package by `bun run generate:helpers`; edit only the copy in
106
+ // `packages/.helper/utils/`.
107
+ /** Parent of every fine role: an omitted fine role resolves to its parent. */
108
+ const ROLE_PARENTS = {
109
+ controlKeyword: 'keyword',
110
+ moduleKeyword: 'keyword',
111
+ definitionKeyword: 'keyword',
112
+ operatorKeyword: 'operator',
113
+ modifier: 'keyword',
114
+ arithmeticOperator: 'operator',
115
+ logicOperator: 'operator',
116
+ compareOperator: 'operator',
117
+ bitwiseOperator: 'operator',
118
+ updateOperator: 'operator',
119
+ derefOperator: 'operator',
120
+ definitionOperator: 'operator',
121
+ typeOperator: 'operator',
122
+ controlOperator: 'operator',
123
+ separator: 'punctuation',
124
+ bracket: 'punctuation',
125
+ paren: 'bracket',
126
+ brace: 'bracket',
127
+ squareBracket: 'bracket',
128
+ angleBracket: 'bracket',
129
+ character: 'name',
130
+ macroName: 'name',
131
+ variable: 'name',
132
+ localVariable: 'variable',
133
+ variableDefinition: 'variable',
134
+ nameDefinition: 'variableDefinition',
135
+ functionDefinition: 'function',
136
+ self: 'variable',
137
+ label: 'name',
138
+ propertyDefinition: 'property',
139
+ method: 'property',
140
+ methodDefinition: 'method',
141
+ specialProperty: 'property',
142
+ typeDefinition: 'type',
143
+ className: 'type',
144
+ namespace: 'type',
145
+ standardTag: 'tag',
146
+ annotation: 'meta',
147
+ documentMeta: 'meta',
148
+ processingInstruction: 'meta',
149
+ attributeValue: 'string',
150
+ literal: 'string',
151
+ docString: 'string',
152
+ regexp: 'string',
153
+ specialString: 'regexp',
154
+ escape: 'string',
155
+ unit: 'number',
156
+ atom: 'constant',
157
+ bool: 'atom',
158
+ null: 'constant',
159
+ constantName: 'constant',
160
+ standardName: 'constant',
161
+ color: 'standardName',
162
+ specialVariable: 'constant',
163
+ docComment: 'comment',
164
+ headingLevel: 'heading',
165
+ heading1: 'headingLevel',
166
+ heading2: 'headingLevel',
167
+ heading3: 'headingLevel',
168
+ heading4: 'headingLevel',
169
+ heading5: 'headingLevel',
170
+ heading6: 'headingLevel',
171
+ list: 'name',
172
+ quote: 'string',
173
+ monospace: 'string',
174
+ contentSeparator: 'punctuation',
175
+ };
176
+ /**
177
+ * Canonical tag → role table shared by every theme: every Lezer base tag and the modifier combinations that the
178
+ * official grammars emit. Each tag appears once, so no rule is shadowed by a later one.
179
+ */
180
+ const SYNTAX_TAGS = [
181
+ ['keyword', [highlight.tags.keyword]],
182
+ ['controlKeyword', [highlight.tags.controlKeyword]],
183
+ ['moduleKeyword', [highlight.tags.moduleKeyword]],
184
+ ['definitionKeyword', [highlight.tags.definitionKeyword]],
185
+ ['operatorKeyword', [highlight.tags.operatorKeyword]],
186
+ ['modifier', [highlight.tags.modifier]],
187
+ ['operator', [highlight.tags.operator]],
188
+ ['arithmeticOperator', [highlight.tags.arithmeticOperator]],
189
+ ['logicOperator', [highlight.tags.logicOperator]],
190
+ ['compareOperator', [highlight.tags.compareOperator]],
191
+ ['bitwiseOperator', [highlight.tags.bitwiseOperator]],
192
+ ['updateOperator', [highlight.tags.updateOperator]],
193
+ ['derefOperator', [highlight.tags.derefOperator]],
194
+ ['definitionOperator', [highlight.tags.definitionOperator]],
195
+ ['typeOperator', [highlight.tags.typeOperator]],
196
+ ['controlOperator', [highlight.tags.controlOperator]],
197
+ ['punctuation', [highlight.tags.punctuation, highlight.tags.function(highlight.tags.punctuation)]],
198
+ ['separator', [highlight.tags.separator]],
199
+ ['bracket', [highlight.tags.bracket]],
200
+ ['paren', [highlight.tags.paren]],
201
+ ['brace', [highlight.tags.brace, highlight.tags.special(highlight.tags.brace)]],
202
+ ['squareBracket', [highlight.tags.squareBracket]],
203
+ ['angleBracket', [highlight.tags.angleBracket]],
204
+ ['name', [highlight.tags.name, highlight.tags.special(highlight.tags.name)]],
205
+ ['character', [highlight.tags.character]],
206
+ ['macroName', [highlight.tags.macroName]],
207
+ ['variable', [highlight.tags.variableName, highlight.tags.standard(highlight.tags.variableName)]],
208
+ ['localVariable', [highlight.tags.local(highlight.tags.variableName)]],
209
+ ['variableDefinition', [highlight.tags.definition(highlight.tags.variableName)]],
210
+ ['nameDefinition', [highlight.tags.definition(highlight.tags.name)]],
211
+ ['function', [highlight.tags.function(highlight.tags.variableName)]],
212
+ ['functionDefinition', [highlight.tags.definition(highlight.tags.function(highlight.tags.variableName))]],
213
+ ['self', [highlight.tags.self]],
214
+ ['label', [highlight.tags.labelName]],
215
+ ['property', [highlight.tags.propertyName]],
216
+ ['propertyDefinition', [highlight.tags.definition(highlight.tags.propertyName)]],
217
+ ['method', [highlight.tags.function(highlight.tags.propertyName)]],
218
+ ['methodDefinition', [highlight.tags.definition(highlight.tags.function(highlight.tags.propertyName))]],
219
+ ['specialProperty', [highlight.tags.special(highlight.tags.propertyName), highlight.tags.definition(highlight.tags.special(highlight.tags.propertyName))]],
220
+ ['type', [highlight.tags.typeName, highlight.tags.standard(highlight.tags.typeName)]],
221
+ ['typeDefinition', [highlight.tags.definition(highlight.tags.typeName)]],
222
+ ['className', [highlight.tags.className, highlight.tags.definition(highlight.tags.className), highlight.tags.constant(highlight.tags.className)]],
223
+ ['namespace', [highlight.tags.namespace]],
224
+ ['tag', [highlight.tags.tagName]],
225
+ ['standardTag', [highlight.tags.standard(highlight.tags.tagName)]],
226
+ ['attribute', [highlight.tags.attributeName, highlight.tags.special(highlight.tags.attributeName)]],
227
+ ['attributeValue', [highlight.tags.attributeValue]],
228
+ ['literal', [highlight.tags.literal]],
229
+ ['string', [highlight.tags.string]],
230
+ ['docString', [highlight.tags.docString]],
231
+ ['regexp', [highlight.tags.regexp]],
232
+ ['specialString', [highlight.tags.special(highlight.tags.string), highlight.tags.special(highlight.tags.docString)]],
233
+ ['escape', [highlight.tags.escape]],
234
+ ['number', [highlight.tags.number, highlight.tags.integer, highlight.tags.float]],
235
+ ['unit', [highlight.tags.unit]],
236
+ ['atom', [highlight.tags.atom]],
237
+ ['bool', [highlight.tags.bool]],
238
+ ['null', [highlight.tags.null]],
239
+ ['constantName', [highlight.tags.constant(highlight.tags.name)]],
240
+ ['standardName', [highlight.tags.standard(highlight.tags.name)]],
241
+ ['color', [highlight.tags.color]],
242
+ ['specialVariable', [highlight.tags.special(highlight.tags.variableName)]],
243
+ ['comment', [highlight.tags.comment, highlight.tags.lineComment, highlight.tags.blockComment]],
244
+ ['docComment', [highlight.tags.docComment]],
245
+ ['meta', [highlight.tags.meta]],
246
+ ['documentMeta', [highlight.tags.documentMeta]],
247
+ ['processingInstruction', [highlight.tags.processingInstruction]],
248
+ ['annotation', [highlight.tags.annotation]],
249
+ ['content', [highlight.tags.content, highlight.tags.special(highlight.tags.content)]],
250
+ ['heading', [highlight.tags.heading]],
251
+ ['heading1', [highlight.tags.heading1]],
252
+ ['heading2', [highlight.tags.heading2]],
253
+ ['heading3', [highlight.tags.heading3]],
254
+ ['heading4', [highlight.tags.heading4]],
255
+ ['heading5', [highlight.tags.heading5]],
256
+ ['heading6', [highlight.tags.heading6]],
257
+ ['list', [highlight.tags.list]],
258
+ ['quote', [highlight.tags.quote]],
259
+ ['monospace', [highlight.tags.monospace]],
260
+ ['contentSeparator', [highlight.tags.contentSeparator]],
261
+ ['link', [highlight.tags.link]],
262
+ ['url', [highlight.tags.url]],
263
+ ['emphasis', [highlight.tags.emphasis]],
264
+ ['strong', [highlight.tags.strong]],
265
+ ['strikethrough', [highlight.tags.strikethrough]],
266
+ ['invalid', [highlight.tags.invalid]],
267
+ ['inserted', [highlight.tags.inserted]],
268
+ ['deleted', [highlight.tags.deleted]],
269
+ ['changed', [highlight.tags.changed]],
270
+ ];
271
+ /** Inline SVG image (same encoding as `@codemirror/lint`), used to draw lint markers in the theme colors. */
272
+ function svg(content, attrs = 'viewBox="0 0 40 40"') {
273
+ return `url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${attrs}>${encodeURIComponent(content)}</svg>')`;
274
+ }
275
+ /** Wavy underline of a lint range. */
276
+ function lintUnderline(color) {
277
+ return svg(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${color}" fill="none" stroke-width=".7"/>`, 'width="6" height="3"');
278
+ }
279
+ /**
280
+ * Canonical UI template: the same selectors for every theme, only palette values differ. Rules of equal specificity
281
+ * keep the order of the original theme files (later rules win).
282
+ */
283
+ function uiTemplate(ui) {
284
+ return {
285
+ '&': {
286
+ color: ui.foreground,
287
+ backgroundColor: ui.background,
288
+ border: ui.border,
289
+ fontSize: generalContent.fontSize,
290
+ fontFamily: generalContent.fontFamily,
291
+ },
292
+ '.cm-content': { caretColor: ui.cursor, lineHeight: generalContent.lineHeight },
293
+ '.cm-cursor, .cm-dropCursor': {
294
+ borderLeftColor: ui.cursor,
295
+ borderLeftWidth: ui.cursorWidth,
296
+ boxShadow: ui.cursorShadow,
297
+ },
298
+ '.cm-cursor-secondary': { borderLeftColor: ui.cursor, opacity: '0.6' },
299
+ '.cm-fat-cursor': {
300
+ backgroundColor: ui.fatCursor.background,
301
+ color: ui.background,
302
+ border: ui.fatCursor.border,
303
+ boxShadow: ui.cursorShadow,
304
+ },
305
+ '&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': { backgroundColor: ui.selection, color: ui.selectionForeground, outline: ui.selectionOutline },
306
+ '&:not(.cm-focused) .cm-selectionBackground': { backgroundColor: ui.selectionInactive },
307
+ '.cm-selectionLayer': { zIndex: 100 },
308
+ '.cm-searchMatch': {
309
+ backgroundColor: ui.searchMatch.background,
310
+ outline: `${ui.outlineWidth} solid ${ui.searchMatch.outline}`,
311
+ color: ui.searchMatch.foreground,
312
+ borderRadius: generalSearchField.borderRadius,
313
+ boxShadow: ui.searchMatch.shadow,
314
+ },
315
+ '.cm-searchMatch span': { color: ui.searchMatch.foreground },
316
+ '.cm-searchMatch.cm-searchMatch-selected': {
317
+ backgroundColor: ui.searchMatch.selectedBackground,
318
+ color: ui.searchMatch.selectedForeground,
319
+ padding: generalSearchField.padding,
320
+ outline: ui.searchMatch.selectedOutline,
321
+ boxShadow: ui.searchMatch.selectedShadow,
322
+ },
323
+ '.cm-searchMatch.cm-searchMatch-selected span': { color: ui.searchMatch.selectedForeground },
324
+ '.cm-search.cm-panel.cm-textfield': {
325
+ color: ui.panel.foreground,
326
+ borderRadius: generalSearchField.borderRadius,
327
+ padding: generalSearchField.padding,
328
+ },
329
+ '.cm-textfield': {
330
+ backgroundColor: ui.panel.inputBackground,
331
+ color: ui.panel.foreground,
332
+ border: ui.panel.inputBorder,
333
+ borderRadius: generalSearchField.borderRadius,
334
+ padding: generalSearchField.padding,
335
+ },
336
+ '.cm-panels': {
337
+ backgroundColor: ui.panel.background,
338
+ color: ui.panel.foreground,
339
+ border: ui.panel.outline,
340
+ borderRadius: generalPanel.borderRadius,
341
+ boxShadow: ui.panel.shadow,
342
+ },
343
+ '.cm-panels.cm-panels-top': { borderBottom: `${ui.panel.borderWidth} solid ${ui.panel.border}` },
344
+ '.cm-panels.cm-panels-bottom': { borderTop: `${ui.panel.borderWidth} solid ${ui.panel.border}` },
345
+ '.cm-panel.cm-gotoLine': { color: ui.panel.foreground, padding: generalPanel.padding },
346
+ '.cm-panel button, .cm-button': {
347
+ backgroundColor: ui.panel.buttonBackground,
348
+ backgroundImage: 'none',
349
+ color: ui.panel.buttonForeground,
350
+ border: ui.panel.buttonBorder,
351
+ borderRadius: generalPanel.borderRadius,
352
+ padding: generalPanel.padding,
353
+ },
354
+ '.cm-panel button:hover, .cm-button:hover': {
355
+ backgroundColor: ui.panel.buttonHoverBackground,
356
+ color: ui.panel.buttonHoverForeground,
357
+ border: ui.panel.buttonHoverBorder,
358
+ boxShadow: ui.panel.buttonHoverShadow,
359
+ },
360
+ '.cm-activeLine': {
361
+ backgroundColor: ui.activeLine,
362
+ borderLeft: ui.activeLineBorder.left,
363
+ borderRight: ui.activeLineBorder.right,
364
+ borderRadius: generalLine.borderRadius,
365
+ zIndex: 1,
366
+ },
367
+ '.cm-gutters': {
368
+ backgroundColor: ui.gutter.background,
369
+ color: ui.gutter.foreground,
370
+ border: generalGutter.border,
371
+ borderRight: `${ui.outlineWidth} solid ${ui.gutter.border}`,
372
+ paddingRight: generalGutter.paddingRight,
373
+ },
374
+ '.cm-activeLineGutter': {
375
+ backgroundColor: ui.gutter.activeBackground,
376
+ color: ui.gutter.activeForeground,
377
+ fontWeight: ui.gutter.activeFontWeight,
378
+ border: ui.gutter.activeBorder,
379
+ },
380
+ '.cm-lineNumbers': { fontSize: generalGutter.fontSize, lineHeight: generalGutter.lineHeight },
381
+ '.cm-foldGutter': { fontSize: generalGutter.fontSize, lineHeight: generalGutter.lineHeight },
382
+ '.cm-foldGutter .cm-gutterElement': { color: ui.gutter.foreground, cursor: 'pointer' },
383
+ '.cm-foldGutter .cm-gutterElement:hover': { color: ui.gutter.foldHover },
384
+ '.cm-gutter-lint': { color: ui.gutter.foreground },
385
+ '.cm-lint-marker': { width: '1em', height: '1em' },
386
+ '.cm-lint-marker-error': {
387
+ content: svg(`<circle cx="20" cy="20" r="15" fill="${ui.diagnostic.error}" stroke="${ui.background}" stroke-width="4"/>`),
388
+ },
389
+ '.cm-lint-marker-warning': {
390
+ content: svg(`<path fill="${ui.diagnostic.warning}" stroke="${ui.background}" stroke-width="4" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>`),
391
+ },
392
+ '.cm-lint-marker-info': {
393
+ content: svg(`<path fill="${ui.diagnostic.info}" stroke="${ui.background}" stroke-width="4" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>`),
394
+ },
395
+ '.cm-changeGutter': { backgroundColor: ui.gutter.background },
396
+ '.cm-merge-b .cm-changedLineGutter, .cm-inlineChangedLineGutter': { background: ui.diff.insertedForeground },
397
+ '.cm-merge-a .cm-changedLineGutter, .cm-deletedLineGutter': { background: ui.diff.deletedForeground },
398
+ '.cm-insertedLine': {
399
+ textDecoration: generalDiff.insertedTextDecoration,
400
+ backgroundColor: ui.diff.insertedBackground,
401
+ color: ui.diff.insertedForeground,
402
+ padding: generalDiff.insertedLinePadding,
403
+ borderRadius: generalDiff.borderRadius,
404
+ },
405
+ 'ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))': {
406
+ textDecoration: generalDiff.insertedTextDecoration,
407
+ backgroundColor: `${ui.diff.insertedBackground} !important`,
408
+ color: ui.diff.insertedForeground,
409
+ padding: generalDiff.insertedLinePadding,
410
+ borderRadius: generalDiff.borderRadius,
411
+ border: ui.diff.insertedBorder,
412
+ },
413
+ 'ins.cm-insertedLine .cm-changedText': { background: 'transparent !important' },
414
+ '.cm-deletedLine': {
415
+ textDecoration: generalDiff.deletedTextDecoration,
416
+ backgroundColor: ui.diff.deletedBackground,
417
+ color: ui.diff.deletedForeground,
418
+ padding: generalDiff.insertedLinePadding,
419
+ borderRadius: generalDiff.borderRadius,
420
+ },
421
+ // Merge view deletions only: `del` decorations, inline deletion widgets and the lines of deleted chunks. `:where()`
422
+ // keeps the specificity of the former bare `del` selector without styling other `del` elements.
423
+ 'del.cm-deletedLine, del.cm-deletedText, :where(.cm-deletedChunk) del, :where(.cm-deletedChunk) del:not(:has(.cm-deletedText))': {
424
+ textDecoration: generalDiff.deletedTextDecoration,
425
+ backgroundColor: `${ui.diff.deletedBackground} !important`,
426
+ color: ui.diff.deletedForeground,
427
+ padding: generalDiff.insertedLinePadding,
428
+ borderRadius: generalDiff.borderRadius,
429
+ border: ui.diff.deletedBorder,
430
+ },
431
+ ':where(.cm-deletedChunk) del .cm-deletedText, :where(.cm-deletedChunk) del .cm-changedText, del:where(.cm-deletedLine) .cm-deletedText, del:where(.cm-deletedLine) .cm-changedText': { background: 'transparent !important' },
432
+ '.cm-merge-b .cm-changedLine, .cm-inlineChangedLine': { backgroundColor: ui.diff.insertedBackground },
433
+ '.cm-merge-a .cm-changedLine, .cm-deletedChunk': { backgroundColor: ui.diff.deletedBackground },
434
+ '.cm-collapsedLines': {
435
+ background: ui.foldPlaceholder.background,
436
+ color: ui.foldPlaceholder.foreground,
437
+ },
438
+ '.cm-mergeSpacer': { background: ui.merge.backgroundColor },
439
+ '.cm-tooltip': {
440
+ backgroundColor: ui.tooltip.background,
441
+ color: ui.tooltip.foreground,
442
+ border: `${ui.outlineWidth} solid ${ui.tooltip.border}`,
443
+ borderRadius: generalTooltip.borderRadius,
444
+ padding: generalTooltip.padding,
445
+ boxShadow: ui.tooltip.shadow,
446
+ },
447
+ '.cm-tooltip-autocomplete > ul': { backgroundColor: ui.tooltip.listBackground, border: ui.tooltip.listBorder },
448
+ '.cm-tooltip-autocomplete > ul > li': { padding: generalTooltip.padding, lineHeight: generalTooltip.lineHeight },
449
+ '.cm-tooltip-autocomplete > ul > li:hover': { backgroundColor: ui.tooltip.hoverBackground },
450
+ '.cm-tooltip-autocomplete > ul > li[aria-selected]': {
451
+ backgroundColor: ui.tooltip.selectedBackground,
452
+ color: ui.tooltip.selectedForeground,
453
+ border: ui.tooltip.selectedBorder,
454
+ borderRadius: generalTooltip.borderRadiusSelected,
455
+ },
456
+ '.cm-tooltip-autocomplete > ul > li > span.cm-completionIcon': {
457
+ color: ui.tooltip.icon,
458
+ paddingRight: generalTooltip.paddingRight,
459
+ },
460
+ '.cm-tooltip-autocomplete > ul > li > span.cm-completionDetail': { color: ui.tooltip.detail, fontStyle: 'italic' },
461
+ '.cm-completionMatchedText': {
462
+ color: 'inherit',
463
+ fontWeight: 'bold',
464
+ textDecoration: 'underline',
465
+ textDecorationColor: ui.matchingBracket.outline,
466
+ },
467
+ '.cm-completionInfo': {
468
+ backgroundColor: ui.tooltip.background,
469
+ color: ui.tooltip.foreground,
470
+ border: `${ui.outlineWidth} solid ${ui.tooltip.border}`,
471
+ padding: generalTooltip.padding,
472
+ },
473
+ '.cm-tooltip .cm-tooltip-arrow:before': { borderTopColor: 'transparent', borderBottomColor: 'transparent' },
474
+ '.cm-tooltip .cm-tooltip-arrow:after': {
475
+ borderTopColor: ui.tooltip.background,
476
+ borderBottomColor: ui.tooltip.background,
477
+ },
478
+ '.cm-tooltip-lint': { color: ui.tooltip.foreground, padding: '0' },
479
+ '.cm-tooltip-section:not(:first-child)': { borderTop: `1px solid ${ui.tooltip.border}` },
480
+ '.cm-diagnostic-error': {
481
+ borderLeft: `${ui.diagnostic.borderWidth} solid ${ui.diagnostic.error}`,
482
+ backgroundColor: ui.diagnostic.errorBackground,
483
+ },
484
+ '.cm-diagnostic-warning': {
485
+ borderLeft: `${ui.diagnostic.borderWidth} solid ${ui.diagnostic.warning}`,
486
+ backgroundColor: ui.diagnostic.warningBackground,
487
+ },
488
+ '.cm-diagnostic-info': {
489
+ borderLeft: `${ui.diagnostic.borderWidth} solid ${ui.diagnostic.info}`,
490
+ backgroundColor: ui.diagnostic.infoBackground,
491
+ },
492
+ '.cm-diagnostic-hint': { borderLeft: `${ui.diagnostic.borderWidth} solid ${ui.diagnostic.hint}` },
493
+ '.cm-diagnosticAction': {
494
+ backgroundColor: ui.panel.buttonBackground,
495
+ color: ui.panel.buttonForeground,
496
+ border: ui.panel.buttonBorder,
497
+ borderRadius: generalPanel.borderRadius,
498
+ },
499
+ '.cm-lintRange-error': { backgroundImage: lintUnderline(ui.diagnostic.error) },
500
+ '.cm-lintRange-warning': { backgroundImage: lintUnderline(ui.diagnostic.warning) },
501
+ '.cm-lintRange-info': { backgroundImage: lintUnderline(ui.diagnostic.info) },
502
+ '.cm-lintRange-hint': { backgroundImage: lintUnderline(ui.diagnostic.hint) },
503
+ '.cm-lintPoint-error': { borderBottom: `${ui.diagnostic.underlineWidth} wavy ${ui.diagnostic.error}` },
504
+ '.cm-lintPoint-warning': { borderBottom: `${ui.diagnostic.underlineWidth} wavy ${ui.diagnostic.warning}` },
505
+ '.cm-lintPoint-info': { borderBottom: `${ui.diagnostic.underlineWidth} wavy ${ui.diagnostic.info}` },
506
+ '.cm-matchingBracket': {
507
+ backgroundColor: ui.matchingBracket.background,
508
+ outline: `${ui.outlineWidth} solid ${ui.matchingBracket.outline}`,
509
+ borderRadius: generalMatching.borderRadius,
510
+ boxShadow: ui.matchingBracket.shadow,
511
+ },
512
+ '.cm-nonmatchingBracket': {
513
+ backgroundColor: ui.nonMatchingBracket.background,
514
+ outline: `${ui.outlineWidth} solid ${ui.nonMatchingBracket.outline}`,
515
+ borderRadius: generalMatching.borderRadius,
516
+ },
517
+ '.cm-selectionMatch': {
518
+ backgroundColor: ui.selectionMatch.background,
519
+ outline: `${ui.outlineWidth} solid ${ui.selectionMatch.outline}`,
520
+ borderRadius: generalMatching.borderRadius,
521
+ },
522
+ '.cm-snippetField': {
523
+ backgroundColor: ui.selectionMatch.background,
524
+ outline: `1px dashed ${ui.selectionMatch.outline}`,
525
+ borderRadius: generalMatching.borderRadius,
526
+ },
527
+ '.cm-snippetFieldPosition': { borderLeft: `1px dotted ${ui.cursor}` },
528
+ '.cm-foldPlaceholder': {
529
+ backgroundColor: ui.foldPlaceholder.background,
530
+ color: ui.foldPlaceholder.foreground,
531
+ border: `${ui.outlineWidth} ${ui.foldPlaceholder.borderStyle} ${ui.foldPlaceholder.border}`,
532
+ borderRadius: generalPlaceholder.borderRadius,
533
+ padding: generalPlaceholder.padding,
534
+ margin: generalPlaceholder.margin,
535
+ },
536
+ // Transparent outline: invisible normally, repainted with the system color in forced-colors mode (drops box-shadow).
537
+ '&.cm-focused': { outline: '2px solid transparent', boxShadow: ui.focusRing },
538
+ '& .cm-scroller::-webkit-scrollbar': { width: generalScroller.width, height: generalScroller.height },
539
+ '& .cm-scroller::-webkit-scrollbar-track': { background: ui.scrollbar.track, border: ui.scrollbar.trackBorder },
540
+ '& .cm-scroller::-webkit-scrollbar-thumb': {
541
+ backgroundColor: ui.scrollbar.thumb,
542
+ borderRadius: generalScroller.borderRadius,
543
+ border: ui.scrollbar.thumbBorder,
544
+ },
545
+ '& .cm-scroller::-webkit-scrollbar-thumb:hover': {
546
+ backgroundColor: ui.scrollbar.thumbHover,
547
+ boxShadow: ui.scrollbar.thumbHoverShadow,
548
+ },
549
+ '.cm-ghostText': { opacity: ui.ghostTextOpacity, color: ui.ghostText },
550
+ '.cm-placeholder': { color: ui.ghostText },
551
+ '.cm-specialChar': { color: ui.specialChar },
552
+ '.cm-trailingSpace': { backgroundColor: ui.diff.deletedBackground },
553
+ '.cm-highlightSpace': {
554
+ backgroundImage: `radial-gradient(circle at 50% 55%, ${ui.gutter.foreground} 20%, transparent 0)`,
555
+ },
556
+ '.cm-crosshair': { cursor: 'crosshair' },
557
+ };
558
+ }
559
+ /** Drops `null` declarations and selectors left without declarations. */
560
+ function emittedRules(spec) {
561
+ const result = {};
562
+ for (const [selector, declarations] of Object.entries(spec)) {
563
+ const emitted = Object.entries(declarations).filter((entry) => entry[1] !== null);
564
+ if (emitted.length > 0)
565
+ result[selector] = Object.fromEntries(emitted);
566
+ }
567
+ return result;
568
+ }
569
+ /** Style of a role, falling back through `ROLE_PARENTS` for omitted fine roles. */
570
+ function resolveRole(syntax, role) {
571
+ let current = role;
572
+ while (current) {
573
+ const style = syntax[current];
574
+ if (style)
575
+ return style;
576
+ current = ROLE_PARENTS[current];
577
+ }
578
+ return {};
579
+ }
580
+ /** Highlight rules of a theme: one rule per entry of the canonical table. */
581
+ function highlightRules(definition) {
582
+ return SYNTAX_TAGS.map(([role, tagList]) => (Object.assign({ tag: [...tagList] }, resolveRole(definition.syntax, role))));
583
+ }
584
+ /** Builds the editor theme, the syntax highlighting and the merge view styles of a theme definition. */
585
+ function defineTheme(definition) {
586
+ const theme = view.EditorView.theme(emittedRules(uiTemplate(definition.ui)), { dark: definition.dark });
587
+ const highlightStyle = language.HighlightStyle.define(highlightRules(definition));
588
+ return {
589
+ extension: [theme, language.syntaxHighlighting(highlightStyle)],
590
+ theme,
591
+ highlightStyle,
592
+ mergeStyles: Object.assign({}, definition.ui.merge),
593
+ };
594
+ }
595
+
109
596
  /**
110
597
  * Enhanced GitHub Light theme color palette
111
598
  * ----------------------------------------
@@ -115,420 +602,203 @@ function applyMergeRevertStyles(styles) {
115
602
  const base00 = '#ffffff', // Background (GitHub light mode background)
116
603
  base01 = '#24292e', // Foreground (main text color)
117
604
  base02 = '#BBDFFF', // Selection - light blue
118
- base03 = '#6e7781', // Comments, subdued text
605
+ base03 = '#6a737d', // Comments, subdued text
119
606
  base04 = '#f6f8fa', // Light gray (gutter, panels)
120
607
  // Syntax highlighting colors
121
608
  base05 = '#116329', // Tag names - GitHub green
122
- base06 = '#6a737d', // Comments, brackets - GitHub gray
609
+ base06 = '#58616b', // Comments, brackets - GitHub gray
123
610
  base07 = '#6f42c1', // Classes, properties - GitHub purple
124
611
  base08 = '#005cc5', // Variables, attributes - GitHub blue
125
- base09 = '#d73a49', // Keywords, types - GitHub red
612
+ base09 = '#c10722', // Keywords, types - GitHub red
126
613
  base0A = '#032f62', // Strings, regexps - GitHub navy
127
- base0B = '#22863a', // Names, quotes - GitHub green
128
- base0C = '#e36209', // Atoms, booleans - GitHub orange
614
+ base0B = '#0e6f2a', // Names, quotes - GitHub green
615
+ base0C = '#953800', // Atoms, booleans - GitHub orange
129
616
  // Background variants
130
617
  base0D = '#f1f8ff', // Active line gutter background
131
618
  base0E = '#e1e4e8', // Panel and tooltip border color
132
619
  base0F = '#f8f9fa'; // Tooltip background
133
620
  // Special states
134
- const invalid = '#cb2431', // Invalid color - error red
621
+ const invalid = '#bf1127', // Invalid color - error red
135
622
  highlightBackground = '#BBDFFF20', // Line highlight (light blue and opacity)
136
- tooltipBackground = base0F, // Tooltip background
137
- cursor = base01, // Caret color
138
- selection = base02, // Selection color
139
623
  activeBracketBg = '#e8f0fe', // Active bracket background
140
624
  activeBracketBorder = '#0366d6', // Active bracket border
141
625
  diagnosticWarning = '#b08800', // Warning color
142
626
  selectionMatch = '#79b8ff40', // Selection match background
143
- linkColor = '#0969da', // Bright blue for links
144
- visitedLinkColor = '#8250df'; // Purple for visited links
627
+ linkColor = '#035cc3', // Bright blue for links
628
+ visitedLinkColor = '#743fcd'; // Purple for visited links
145
629
  // Diff/merge specific colors
146
630
  const addedBackground = '#e6ffec80', // GitHub light green with transparency
147
631
  removedBackground = '#ffebe980', // GitHub light red with transparency
148
- addedText = '#0f6d31', // GitHub dark green for added text
149
- removedText = '#cf222e'; // GitHub red for removed text
150
- /**
151
- * Enhanced editor theme styles for GitHub Light
152
- */
153
- const githubLightTheme = view.EditorView.theme({
154
- // Base editor styles
155
- '&': {
156
- color: base01,
157
- backgroundColor: base00,
158
- fontSize: generalContent.fontSize,
159
- fontFamily: generalContent.fontFamily,
160
- },
161
- // Content and cursor
162
- '.cm-content': {
163
- caretColor: cursor,
164
- lineHeight: generalContent.lineHeight,
165
- },
166
- '.cm-cursor, .cm-dropCursor': {
167
- borderLeftColor: cursor,
168
- borderLeftWidth: generalCursor.borderLeftWidth,
169
- },
170
- '.cm-fat-cursor': {
171
- backgroundColor: `${cursor}99`,
172
- color: base00,
173
- },
174
- // Selection
175
- '&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': {
176
- backgroundColor: selection,
177
- color: base01,
178
- },
179
- // Make sure selection appears above active line
180
- '.cm-selectionLayer': {
181
- zIndex: 100,
182
- },
183
- // Search functionality
184
- '.cm-searchMatch': {
185
- backgroundColor: '#daebff',
186
- outline: `1px solid ${base08}`,
187
- color: base01,
188
- borderRadius: generalSearchField.borderRadius,
189
- '& span': {
190
- color: base01,
632
+ addedText = '#0f6d31'; // GitHub dark green for added text
633
+ const theme = defineTheme({
634
+ dark: false,
635
+ ui: {
636
+ background: base00,
637
+ foreground: base01,
638
+ border: 'none',
639
+ cursor: base01,
640
+ cursorWidth: '2px',
641
+ cursorShadow: 'none',
642
+ fatCursor: { background: `${base01}99`, border: 'none' },
643
+ selection: base02,
644
+ selectionInactive: base02,
645
+ selectionForeground: base01,
646
+ selectionOutline: 'none',
647
+ activeLine: highlightBackground,
648
+ activeLineBorder: { left: 'none', right: 'none' },
649
+ ghostText: '#959da5',
650
+ ghostTextOpacity: '0.5',
651
+ specialChar: invalid,
652
+ focusRing: `0 0 0 2px ${base00}, 0 0 0 4px ${linkColor}`,
653
+ outlineWidth: '1px',
654
+ searchMatch: {
655
+ background: '#daebff',
656
+ outline: base08,
657
+ foreground: base01,
658
+ shadow: 'none',
659
+ selectedBackground: '#79b8ff',
660
+ selectedForeground: base00,
661
+ selectedOutline: `1px solid ${base08}`,
662
+ selectedShadow: 'none',
191
663
  },
192
- },
193
- '.cm-searchMatch.cm-searchMatch-selected': {
194
- backgroundColor: '#79b8ff',
195
- color: base00,
196
- padding: generalSearchField.padding,
197
- '& span': {
198
- color: base00,
664
+ selectionMatch: { background: selectionMatch, outline: `${base02}50` },
665
+ matchingBracket: { background: activeBracketBg, outline: `${activeBracketBorder}b0`, shadow: 'none' },
666
+ nonMatchingBracket: { background: '#ffeef080', outline: invalid },
667
+ panel: {
668
+ background: base04,
669
+ foreground: base03,
670
+ border: base0E,
671
+ borderWidth: '1px',
672
+ outline: 'none',
673
+ shadow: 'none',
674
+ buttonBackground: base00,
675
+ buttonForeground: base01,
676
+ buttonBorder: 'none',
677
+ buttonHoverBackground: '#f5f5f5',
678
+ buttonHoverForeground: base01,
679
+ buttonHoverBorder: 'none',
680
+ buttonHoverShadow: 'none',
681
+ inputBackground: base00,
682
+ inputBorder: `1px solid ${base0E}`,
199
683
  },
200
- },
201
- '.cm-search.cm-panel.cm-textfield': {
202
- color: base01,
203
- borderRadius: generalSearchField.borderRadius,
204
- padding: generalSearchField.padding,
205
- },
206
- // Panels
207
- '.cm-panels': {
208
- backgroundColor: base04,
209
- color: base03,
210
- borderRadius: '0 0 4px 4px',
211
- },
212
- '.cm-panels.cm-panels-top': {
213
- borderBottom: `1px solid ${base0E}`,
214
- },
215
- '.cm-panels.cm-panels-bottom': {
216
- borderTop: `1px solid ${base0E}`,
217
- },
218
- '.cm-panel button': {
219
- backgroundColor: base00,
220
- color: base01,
221
- border: generalPanel.border,
222
- borderRadius: generalPanel.borderRadius,
223
- padding: generalPanel.padding,
224
- },
225
- '.cm-panel button:hover': {
226
- backgroundColor: '#f5f5f5',
227
- },
228
- // Line highlighting
229
- '.cm-activeLine': {
230
- backgroundColor: highlightBackground,
231
- borderRadius: generalLine.borderRadius,
232
- zIndex: 1,
233
- },
234
- // Gutters
235
- '.cm-gutters': {
236
- backgroundColor: base04,
237
- color: base03,
238
- border: generalGutter.border,
239
- borderRight: `1px solid ${base0E}`,
240
- paddingRight: generalGutter.paddingRight,
241
- },
242
- '.cm-activeLineGutter': {
243
- backgroundColor: base0D,
244
- color: base01,
245
- fontWeight: generalGutter.fontWeight,
246
- },
247
- '.cm-lineNumbers': {
248
- fontSize: generalGutter.fontSize,
249
- lineHeight: generalGutter.lineHeight,
250
- },
251
- '.cm-foldGutter': {
252
- fontSize: generalGutter.fontSize,
253
- lineHeight: generalGutter.lineHeight,
254
- },
255
- '.cm-foldGutter .cm-gutterElement': {
256
- color: base03,
257
- cursor: 'pointer',
258
- },
259
- '.cm-foldGutter .cm-gutterElement:hover': {
260
- color: base01,
261
- },
262
- // Diff/Merge View Styles
263
- // Inserted/Added Content
264
- '.cm-insertedLine': {
265
- textDecoration: generalDiff.insertedTextDecoration,
266
- backgroundColor: addedBackground,
267
- color: addedText,
268
- padding: generalDiff.insertedLinePadding,
269
- borderRadius: generalDiff.borderRadius,
270
- },
271
- 'ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))': {
272
- textDecoration: generalDiff.insertedTextDecoration,
273
- backgroundColor: `${addedBackground} !important`,
274
- color: addedText,
275
- padding: generalDiff.insertedLinePadding,
276
- borderRadius: generalDiff.borderRadius,
277
- border: `1px solid ${addedText}30`,
278
- },
279
- 'ins.cm-insertedLine .cm-changedText': {
280
- background: 'transparent !important',
281
- },
282
- // Deleted/Removed Content
283
- '.cm-deletedLine': {
284
- textDecoration: generalDiff.deletedTextDecoration,
285
- backgroundColor: removedBackground,
286
- color: removedText,
287
- padding: generalDiff.insertedLinePadding,
288
- borderRadius: generalDiff.borderRadius,
289
- },
290
- 'del.cm-deletedLine, del, del:not(:has(.cm-deletedText))': {
291
- textDecoration: generalDiff.deletedTextDecoration,
292
- backgroundColor: `${removedBackground} !important`,
293
- color: removedText,
294
- padding: generalDiff.insertedLinePadding,
295
- borderRadius: generalDiff.borderRadius,
296
- border: `1px solid ${removedText}30`,
297
- },
298
- 'del .cm-deletedText, del .cm-changedText': {
299
- background: 'transparent !important',
300
- },
301
- // Tooltips and autocomplete
302
- '.cm-tooltip': {
303
- backgroundColor: tooltipBackground,
304
- border: `1px solid ${base0E}`,
305
- borderRadius: generalTooltip.borderRadius,
306
- padding: generalTooltip.padding,
307
- boxShadow: '0 1px 5px rgba(0, 0, 0, 0.1)',
308
- },
309
- '.cm-tooltip-autocomplete': {
310
- '& > ul': {
311
- backgroundColor: tooltipBackground,
312
- border: 'none',
684
+ gutter: {
685
+ background: base04,
686
+ foreground: base03,
687
+ border: base0E,
688
+ activeBackground: base0D,
689
+ activeForeground: base01,
690
+ activeFontWeight: '500',
691
+ activeBorder: 'none',
692
+ foldHover: base01,
313
693
  },
314
- '& > ul > li': {
315
- padding: generalTooltip.padding,
316
- lineHeight: generalTooltip.lineHeight,
694
+ foldPlaceholder: { background: selectionMatch, foreground: base03, border: `${base0E}70`, borderStyle: 'dotted' },
695
+ tooltip: {
696
+ background: base0F,
697
+ foreground: base01,
698
+ border: base0E,
699
+ shadow: '0 1px 5px rgba(0, 0, 0, 0.1)',
700
+ listBackground: base0F,
701
+ listBorder: 'none',
702
+ hoverBackground: `${activeBracketBorder}15`,
703
+ selectedBackground: `${activeBracketBorder}30`,
704
+ selectedForeground: base01,
705
+ selectedBorder: 'none',
706
+ icon: base03,
707
+ detail: base03,
317
708
  },
318
- '& > ul > li[aria-selected]': {
319
- backgroundColor: '#0366d630',
320
- color: base01,
321
- borderRadius: generalTooltip.borderRadiusSelected,
709
+ diff: {
710
+ insertedBackground: addedBackground,
711
+ insertedForeground: addedText,
712
+ insertedBorder: `1px solid ${addedText}30`,
713
+ deletedBackground: removedBackground,
714
+ deletedForeground: base09,
715
+ deletedBorder: `1px solid ${base09}30`,
322
716
  },
323
- '& > ul > li:hover': {
324
- backgroundColor: '#0366d615',
717
+ diagnostic: {
718
+ error: invalid,
719
+ warning: diagnosticWarning,
720
+ info: linkColor,
721
+ hint: linkColor,
722
+ errorBackground: 'transparent',
723
+ warningBackground: 'transparent',
724
+ infoBackground: 'transparent',
725
+ borderWidth: '3px',
726
+ underlineWidth: '2px',
325
727
  },
326
- '& > ul > li > span.cm-completionIcon': {
327
- color: base03,
328
- paddingRight: generalTooltip.paddingRight,
728
+ scrollbar: {
729
+ track: base0E,
730
+ trackBorder: 'none',
731
+ thumb: base01,
732
+ thumbBorder: `3px solid ${base0E}`,
733
+ thumbHover: base06,
734
+ thumbHoverShadow: 'none',
329
735
  },
330
- '& > ul > li > span.cm-completionDetail': {
331
- color: base03,
332
- fontStyle: 'italic',
736
+ merge: {
737
+ backgroundColor: base0F,
738
+ borderColor: base0E,
739
+ buttonColor: base01,
740
+ buttonHoverColor: '#f5f5f5',
333
741
  },
334
742
  },
335
- '.cm-tooltip .cm-tooltip-arrow:before': {
336
- borderTopColor: 'transparent',
337
- borderBottomColor: 'transparent',
338
- },
339
- '.cm-tooltip .cm-tooltip-arrow:after': {
340
- borderTopColor: tooltipBackground,
341
- borderBottomColor: tooltipBackground,
342
- },
343
- // Diagnostics styling
344
- '.cm-diagnostic': {
345
- '&-error': {
346
- borderLeft: `3px solid ${invalid}`,
347
- },
348
- '&-warning': {
349
- borderLeft: `3px solid ${diagnosticWarning}`,
743
+ syntax: {
744
+ keyword: { color: base09, fontWeight: 'bold' },
745
+ definitionKeyword: { color: base09 },
746
+ modifier: { color: base0C, fontStyle: 'italic' },
747
+ functionDefinition: { color: base08 },
748
+ operator: { color: base01 },
749
+ punctuation: { color: base06 },
750
+ name: { color: base08 },
751
+ function: { color: base0B },
752
+ self: { color: base0C },
753
+ label: { color: base0B },
754
+ property: { color: base07, fontStyle: 'normal' },
755
+ type: { color: base09 },
756
+ typeDefinition: { color: base09, fontWeight: 'bold' },
757
+ className: { color: base07, fontStyle: 'italic' },
758
+ namespace: { color: base08, fontStyle: 'italic' },
759
+ tag: { color: base05 },
760
+ attribute: { color: base07 },
761
+ content: { color: base01 },
762
+ string: { color: base0A },
763
+ number: { color: base0C },
764
+ constant: { color: base0C },
765
+ comment: { fontStyle: 'italic', color: base06 },
766
+ meta: { color: base06 },
767
+ processingInstruction: { color: base0B },
768
+ annotation: { color: invalid, fontStyle: 'italic' },
769
+ heading: { fontWeight: 'bold', color: base08 },
770
+ headingLevel: { color: base08 },
771
+ quote: { color: base06 },
772
+ monospace: { color: base01 },
773
+ contentSeparator: { color: base08 },
774
+ link: {
775
+ color: visitedLinkColor,
776
+ fontWeight: '500',
777
+ textDecoration: 'underline',
778
+ textUnderlinePosition: 'under',
350
779
  },
351
- '&-info': {
352
- borderLeft: `3px solid ${linkColor}`,
780
+ url: { color: linkColor, textDecoration: 'underline', textUnderlineOffset: '2px' },
781
+ emphasis: { fontStyle: 'italic', color: base0A },
782
+ strong: { fontWeight: 'bold', color: base08 },
783
+ strikethrough: { color: invalid, textDecoration: 'line-through' },
784
+ invalid: {
785
+ color: base01,
786
+ textDecoration: 'underline wavy',
787
+ borderBottom: `1px wavy ${invalid}`,
353
788
  },
789
+ inserted: { color: base0B },
790
+ deleted: { color: invalid },
791
+ changed: { color: base0C },
354
792
  },
355
- '.cm-lintPoint-error': {
356
- borderBottom: `2px wavy ${invalid}`,
357
- },
358
- '.cm-lintPoint-warning': {
359
- borderBottom: `2px wavy ${diagnosticWarning}`,
360
- },
361
- // Matching brackets
362
- '.cm-matchingBracket': {
363
- backgroundColor: activeBracketBg,
364
- outline: `1px solid ${activeBracketBorder}80`,
365
- borderRadius: generalMatching.borderRadius,
366
- },
367
- '.cm-nonmatchingBracket': {
368
- backgroundColor: '#ffeef080',
369
- outline: `1px solid ${invalid}`,
370
- borderRadius: generalMatching.borderRadius,
371
- },
372
- // Selection matches
373
- '.cm-selectionMatch': {
374
- backgroundColor: selectionMatch,
375
- outline: `1px solid ${base02}50`,
376
- borderRadius: generalMatching.borderRadius,
377
- },
378
- // Fold placeholder
379
- '.cm-foldPlaceholder': {
380
- backgroundColor: selectionMatch,
381
- color: base03,
382
- border: `1px dotted ${base0E}70`,
383
- borderRadius: generalPlaceholder.borderRadius,
384
- padding: generalPlaceholder.padding,
385
- margin: generalPlaceholder.margin,
386
- },
387
- // Focus outline
388
- '&.cm-focused': {
389
- outline: 'none',
390
- boxShadow: `0 0 0 2px ${base00}, 0 0 0 3px ${linkColor}40`,
391
- },
392
- // Scrollbars
393
- '& .cm-scroller::-webkit-scrollbar': {
394
- width: generalScroller.width,
395
- height: generalScroller.height,
396
- },
397
- '& .cm-scroller::-webkit-scrollbar-track': {
398
- background: base0E,
399
- },
400
- '& .cm-scroller::-webkit-scrollbar-thumb': {
401
- backgroundColor: base01,
402
- borderRadius: generalScroller.borderRadius,
403
- border: `3px solid ${base0E}`,
404
- },
405
- '& .cm-scroller::-webkit-scrollbar-thumb:hover': {
406
- backgroundColor: base06,
407
- },
408
- // Ghost text
409
- '.cm-ghostText': {
410
- opacity: '0.5',
411
- color: '#959da5',
412
- },
413
- }, { dark: false });
414
- /**
415
- * Enhanced syntax highlighting for GitHub Light theme
416
- */
417
- const githubLightHighlightStyle = language.HighlightStyle.define([
418
- // Keywords and control flow
419
- { tag: highlight.tags.keyword, color: base09, fontWeight: 'bold' },
420
- { tag: highlight.tags.controlKeyword, color: base09, fontWeight: 'bold' },
421
- { tag: highlight.tags.moduleKeyword, color: base09, fontWeight: 'bold' },
422
- // Names and variables
423
- { tag: [highlight.tags.name, highlight.tags.deleted, highlight.tags.character, highlight.tags.macroName], color: base08 },
424
- { tag: [highlight.tags.variableName], color: base08 },
425
- { tag: [highlight.tags.propertyName], color: base07, fontStyle: 'normal' },
426
- // Classes and types
427
- { tag: [highlight.tags.typeName], color: base09 },
428
- { tag: [highlight.tags.className], color: base07, fontStyle: 'italic' },
429
- { tag: [highlight.tags.namespace], color: base08, fontStyle: 'italic' },
430
- // Operators and punctuation
431
- { tag: [highlight.tags.operator, highlight.tags.operatorKeyword], color: base01 },
432
- { tag: [highlight.tags.bracket], color: base06 },
433
- { tag: [highlight.tags.brace], color: base06 },
434
- { tag: [highlight.tags.punctuation], color: base06 },
435
- // Functions and parameters
436
- { tag: [highlight.tags.function(highlight.tags.variableName), highlight.tags.labelName], color: base0B },
437
- { tag: [highlight.tags.definition(highlight.tags.variableName)], color: base08 },
438
- // Constants and literals
439
- { tag: highlight.tags.number, color: base0C },
440
- { tag: highlight.tags.changed, color: base0C },
441
- { tag: highlight.tags.annotation, color: invalid, fontStyle: 'italic' },
442
- { tag: highlight.tags.modifier, color: base0C, fontStyle: 'italic' },
443
- { tag: highlight.tags.self, color: base0C },
444
- { tag: [highlight.tags.color, highlight.tags.constant(highlight.tags.name), highlight.tags.standard(highlight.tags.name)], color: base0C },
445
- { tag: [highlight.tags.atom, highlight.tags.bool, highlight.tags.special(highlight.tags.variableName)], color: base0C },
446
- // Strings and regex
447
- { tag: [highlight.tags.processingInstruction, highlight.tags.inserted], color: base0B },
448
- { tag: [highlight.tags.special(highlight.tags.string), highlight.tags.regexp], color: base0A },
449
- { tag: highlight.tags.string, color: base0A },
450
- // Punctuation and structure
451
- { tag: highlight.tags.definition(highlight.tags.typeName), color: base09, fontWeight: 'bold' },
452
- // Comments and documentation
453
- { tag: highlight.tags.meta, color: base06 },
454
- { tag: highlight.tags.comment, fontStyle: 'italic', color: base06 },
455
- { tag: highlight.tags.docComment, fontStyle: 'italic', color: base06 },
456
- // HTML/XML elements
457
- { tag: [highlight.tags.tagName], color: base05 },
458
- { tag: [highlight.tags.attributeName], color: base07 },
459
- // Markdown and text formatting
460
- { tag: [highlight.tags.heading], fontWeight: 'bold', color: base08 },
461
- { tag: [highlight.tags.strong], fontWeight: 'bold', color: base08 },
462
- { tag: [highlight.tags.emphasis], fontStyle: 'italic', color: base0A },
463
- // Links and URLs
464
- {
465
- tag: [highlight.tags.link],
466
- color: visitedLinkColor,
467
- fontWeight: '500',
468
- textDecoration: 'underline',
469
- textUnderlinePosition: 'under',
470
- },
471
- {
472
- tag: [highlight.tags.url],
473
- color: linkColor,
474
- textDecoration: 'underline',
475
- textUnderlineOffset: '2px',
476
- },
477
- // Special states
478
- {
479
- tag: [highlight.tags.invalid],
480
- color: base01,
481
- textDecoration: 'underline wavy',
482
- borderBottom: `1px wavy ${invalid}`,
483
- },
484
- { tag: [highlight.tags.strikethrough], color: invalid, textDecoration: 'line-through' },
485
- // Enhanced syntax highlighting
486
- { tag: highlight.tags.constant(highlight.tags.name), color: base0C },
487
- { tag: highlight.tags.deleted, color: invalid },
488
- { tag: highlight.tags.squareBracket, color: base06 },
489
- { tag: highlight.tags.angleBracket, color: base06 },
490
- // Additional specific styles
491
- { tag: highlight.tags.monospace, color: base01 },
492
- { tag: [highlight.tags.contentSeparator], color: base08 },
493
- { tag: highlight.tags.quote, color: base06 },
494
- { tag: highlight.tags.integer, color: base0C },
495
- { tag: highlight.tags.float, color: base0C },
496
- { tag: highlight.tags.null, color: base0C },
497
- { tag: highlight.tags.attributeValue, color: base0A },
498
- { tag: highlight.tags.escape, color: base0A },
499
- { tag: highlight.tags.paren, color: base06 },
500
- { tag: highlight.tags.lineComment, color: base06, fontStyle: 'italic' },
501
- { tag: highlight.tags.blockComment, color: base06, fontStyle: 'italic' },
502
- { tag: highlight.tags.definitionKeyword, color: base09 },
503
- { tag: highlight.tags.arithmeticOperator, color: base01 },
504
- { tag: highlight.tags.logicOperator, color: base01 },
505
- { tag: highlight.tags.compareOperator, color: base01 },
506
- { tag: highlight.tags.bitwiseOperator, color: base01 },
507
- { tag: highlight.tags.updateOperator, color: base01 },
508
- { tag: highlight.tags.derefOperator, color: base01 },
509
- { tag: highlight.tags.local(highlight.tags.variableName), color: base08 },
510
- { tag: highlight.tags.list, color: base08 },
511
- { tag: highlight.tags.unit, color: base0C },
512
- { tag: highlight.tags.heading1, color: base08 },
513
- { tag: highlight.tags.heading2, color: base08 },
514
- { tag: highlight.tags.heading3, color: base08 },
515
- { tag: highlight.tags.heading4, color: base08 },
516
- { tag: highlight.tags.heading5, color: base08 },
517
- { tag: highlight.tags.heading6, color: base08 },
518
- ]);
793
+ });
519
794
  /**
520
795
  * Combined GitHub Light theme extension
521
796
  */
522
- const githubLight = [githubLightTheme, language.syntaxHighlighting(githubLightHighlightStyle)];
797
+ const githubLight = theme.extension;
523
798
  /**
524
799
  * GitHub Light merge revert styles configuration
525
800
  */
526
- const githubLightMergeStyles = {
527
- backgroundColor: tooltipBackground,
528
- borderColor: base0E,
529
- buttonColor: base01,
530
- buttonHoverColor: '#f5f5f5',
531
- };
801
+ const githubLightMergeStyles = theme.mergeStyles;
532
802
 
533
803
  exports.applyMergeRevertStyles = applyMergeRevertStyles;
534
804
  exports.githubLight = githubLight;