@fsegurai/codemirror-theme-high-contrast-dark 6.0.2 → 6.1.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 +661 -365
  3. package/dist/index.js +661 -365
  4. package/package.json +12 -3
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var view = require('@codemirror/view');
4
3
  var language = require('@codemirror/language');
4
+ var view = require('@codemirror/view');
5
5
  var highlight = require('@lezer/highlight');
6
6
 
7
7
  // Helper module for styling options
@@ -101,6 +101,498 @@ function applyMergeRevertStyles(styles) {
101
101
  document.head.appendChild(styleEl);
102
102
  }
103
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
+
104
596
  /**
105
597
  * High Contrast Dark theme color definitions
106
598
  * ------------------------------------------
@@ -110,393 +602,197 @@ function applyMergeRevertStyles(styles) {
110
602
  const base00 = '#000000', // Background - pure black
111
603
  base01 = '#0a0a0a', // Darker background
112
604
  base02 = '#1f1f1f', // Selection background
113
- base03 = '#808080', // Comments - medium grey
605
+ base03 = '#a1a1a1', // Comments - medium grey
114
606
  base04 = '#b0b0b0', // Dark grey
115
607
  base05 = '#ffffff', // Foreground - pure white
116
608
  // High contrast accent colors
117
- brightYellow = '#ffff00', brightCyan = '#00ffff', brightGreen = '#00ff00', brightRed = '#ff0000', brightMagenta = '#ff00ff', brightBlue = '#0099ff', brightOrange = '#ff9900', brightPurple = '#cc66ff';
609
+ brightYellow = '#ffff00', brightCyan = '#00ffff', brightGreen = '#00ff00', brightRed = '#ff7967', brightMagenta = '#fe5dfb', brightBlue = '#42a6ff', brightOrange = '#ff9900', brightPurple = '#cf81f9';
118
610
  // UI specific colors
119
- const invalid = brightRed, darkBackground = base00, background = base00, tooltipBackground = '#1a1a1a', selection = '#264f78', selectionMatch = '#264f7880', cursor = brightYellow, activeBracketBg = '#1f1f1f', activeBracketBorder = brightCyan, diagnosticWarning = brightYellow, linkColor = brightCyan, visitedLinkColor = brightMagenta;
611
+ const tooltipBackground = '#1a1a1a', selection = '#264f78', selectionMatch = '#264f7880';
120
612
  // Diff/merge specific colors
121
- const addedBackground = '#00550060', removedBackground = '#55000060', addedText = brightGreen, removedText = brightRed;
122
- /**
123
- * Enhanced editor theme styles for High Contrast Dark
124
- */
125
- const highContrastDarkTheme = view.EditorView.theme({
126
- // Base editor styles
127
- '&': {
128
- color: base05,
129
- backgroundColor: background,
130
- fontSize: generalContent.fontSize,
131
- fontFamily: generalContent.fontFamily,
613
+ const addedBackground = '#00550060', removedBackground = '#55000060';
614
+ const theme = defineTheme({
615
+ dark: true,
616
+ ui: {
617
+ background: base00,
618
+ foreground: base05,
132
619
  border: `1px solid ${base04}`,
133
- },
134
- // Content and cursor
135
- '.cm-content': {
136
- caretColor: cursor,
137
- lineHeight: generalContent.lineHeight,
138
- },
139
- '.cm-cursor, .cm-dropCursor': {
140
- borderLeftColor: cursor,
141
- borderLeftWidth: '3px',
142
- },
143
- '.cm-fat-cursor': {
144
- backgroundColor: cursor,
145
- color: background,
146
- border: `2px solid ${base05}`,
147
- },
148
- // Selection
149
- '&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': {
150
- backgroundColor: '#3a5a8a',
151
- outline: `2px solid ${brightCyan}`,
152
- },
153
- // Make sure selection appears above active line
154
- '.cm-selectionLayer': {
155
- zIndex: 100,
156
- },
157
- // Search functionality
158
- '.cm-searchMatch': {
159
- backgroundColor: '#006400',
160
- outline: `2px solid ${brightGreen}`,
161
- color: base05,
162
- borderRadius: generalSearchField.borderRadius,
163
- '& span': {
164
- color: base05,
620
+ cursor: brightYellow,
621
+ cursorWidth: '3px',
622
+ cursorShadow: 'none',
623
+ fatCursor: { background: brightYellow, border: `2px solid ${base05}` },
624
+ selection: '#1a3865',
625
+ selectionInactive: '#1a3865',
626
+ selectionForeground: null,
627
+ selectionOutline: `2px solid ${brightCyan}`,
628
+ activeLine: '#2a2a2a82',
629
+ activeLineBorder: { left: `3px solid ${brightCyan}`, right: `1px solid ${base04}` },
630
+ ghostText: base03,
631
+ ghostTextOpacity: '0.7',
632
+ specialChar: brightRed,
633
+ searchMatch: {
634
+ background: '#006400',
635
+ outline: brightGreen,
636
+ foreground: base05,
637
+ shadow: 'none',
638
+ selectedBackground: brightGreen,
639
+ selectedForeground: base00,
640
+ selectedOutline: `2px solid ${base05}`,
641
+ selectedShadow: 'none',
165
642
  },
166
- },
167
- '.cm-searchMatch.cm-searchMatch-selected': {
168
- backgroundColor: brightGreen,
169
- color: base00,
170
- padding: generalSearchField.padding,
171
- outline: `2px solid ${base05}`,
172
- '& span': {
173
- color: base00,
643
+ selectionMatch: { background: selectionMatch, outline: `${brightCyan}50` },
644
+ matchingBracket: { background: base02, outline: brightCyan, shadow: 'none' },
645
+ nonMatchingBracket: { background: '#33000050', outline: brightRed },
646
+ panel: {
647
+ background: base00,
648
+ foreground: base05,
649
+ border: base04,
650
+ borderWidth: '2px',
651
+ outline: `1px solid ${base04}`,
652
+ shadow: 'none',
653
+ buttonBackground: tooltipBackground,
654
+ buttonForeground: brightCyan,
655
+ buttonBorder: `1px solid ${base04}`,
656
+ buttonHoverBackground: base02,
657
+ buttonHoverForeground: brightCyan,
658
+ buttonHoverBorder: `1px solid ${brightCyan}`,
659
+ buttonHoverShadow: 'none',
660
+ inputBackground: base01,
661
+ inputBorder: `1px solid ${base04}`,
174
662
  },
175
- },
176
- '.cm-search.cm-panel.cm-textfield': {
177
- color: base05,
178
- backgroundColor: base01,
179
- border: `1px solid ${base04}`,
180
- borderRadius: generalSearchField.borderRadius,
181
- padding: generalSearchField.padding,
182
- },
183
- // Panels
184
- '.cm-panels': {
185
- backgroundColor: darkBackground,
186
- color: base05,
187
- borderRadius: '4px',
188
- border: `1px solid ${base04}`,
189
- },
190
- '.cm-panels.cm-panels-top': {
191
- borderBottom: `2px solid ${base04}`,
192
- },
193
- '.cm-panels.cm-panels-bottom': {
194
- borderTop: `2px solid ${base04}`,
195
- },
196
- '.cm-panel button': {
197
- backgroundColor: tooltipBackground,
198
- color: brightCyan,
199
- border: `1px solid ${base04}`,
200
- borderRadius: generalPanel.borderRadius,
201
- padding: generalPanel.padding,
202
- },
203
- '.cm-panel button:hover': {
204
- backgroundColor: base02,
205
- border: `1px solid ${brightCyan}`,
206
- },
207
- // Line highlighting
208
- '.cm-activeLine': {
209
- backgroundColor: '#2a2a2aa6',
210
- borderRadius: generalLine.borderRadius,
211
- borderLeft: `3px solid ${brightCyan}`,
212
- borderRight: `1px solid ${base04}`,
213
- zIndex: 1,
214
- },
215
- // Gutters
216
- '.cm-gutters': {
217
- backgroundColor: darkBackground,
218
- color: base04,
219
- border: generalGutter.border,
220
- borderRight: `2px solid ${base04}`,
221
- paddingRight: generalGutter.paddingRight,
222
- },
223
- '.cm-activeLineGutter': {
224
- backgroundColor: base02,
225
- color: brightYellow,
226
- fontWeight: 'bold',
227
- border: `1px solid ${base03}`,
228
- },
229
- '.cm-lineNumbers': {
230
- fontSize: generalGutter.fontSize,
231
- lineHeight: generalGutter.lineHeight,
232
- },
233
- '.cm-foldGutter': {
234
- fontSize: generalGutter.fontSize,
235
- lineHeight: generalGutter.lineHeight,
236
- },
237
- '.cm-foldGutter .cm-gutterElement': {
238
- color: base04,
239
- cursor: 'pointer',
240
- },
241
- '.cm-foldGutter .cm-gutterElement:hover': {
242
- color: brightCyan,
243
- },
244
- // Diff/Merge View Styles
245
- '.cm-insertedLine': {
246
- textDecoration: generalDiff.insertedTextDecoration,
247
- backgroundColor: addedBackground,
248
- color: addedText,
249
- padding: generalDiff.insertedLinePadding,
250
- borderRadius: generalDiff.borderRadius,
251
- border: `1px solid ${addedText}`,
252
- },
253
- 'ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))': {
254
- textDecoration: generalDiff.insertedTextDecoration,
255
- backgroundColor: `${addedBackground} !important`,
256
- color: addedText,
257
- padding: generalDiff.insertedLinePadding,
258
- borderRadius: generalDiff.borderRadius,
259
- border: `1px solid ${addedText}`,
260
- },
261
- 'ins.cm-insertedLine .cm-changedText': {
262
- background: 'transparent !important',
263
- },
264
- '.cm-deletedLine': {
265
- textDecoration: generalDiff.deletedTextDecoration,
266
- backgroundColor: removedBackground,
267
- color: removedText,
268
- padding: generalDiff.insertedLinePadding,
269
- borderRadius: generalDiff.borderRadius,
270
- border: `1px solid ${removedText}`,
271
- },
272
- 'del.cm-deletedLine, del, del:not(:has(.cm-deletedText))': {
273
- textDecoration: generalDiff.deletedTextDecoration,
274
- backgroundColor: `${removedBackground} !important`,
275
- color: removedText,
276
- padding: generalDiff.insertedLinePadding,
277
- borderRadius: generalDiff.borderRadius,
278
- border: `1px solid ${removedText}`,
279
- },
280
- 'del .cm-deletedText, del .cm-changedText': {
281
- background: 'transparent !important',
282
- },
283
- // Tooltips and autocomplete
284
- '.cm-tooltip': {
285
- backgroundColor: tooltipBackground,
286
- border: `2px solid ${brightCyan}`,
287
- borderRadius: generalTooltip.borderRadius,
288
- padding: generalTooltip.padding,
289
- color: base05,
290
- },
291
- '.cm-tooltip-autocomplete': {
292
- '& > ul': {
293
- backgroundColor: tooltipBackground,
294
- border: `1px solid ${base04}`,
295
- },
296
- '& > ul > li': {
297
- padding: generalTooltip.padding,
298
- lineHeight: generalTooltip.lineHeight,
663
+ gutter: {
664
+ background: base00,
665
+ foreground: base04,
666
+ border: base04,
667
+ activeBackground: base02,
668
+ activeForeground: brightYellow,
669
+ activeFontWeight: 'bold',
670
+ activeBorder: `1px solid ${base03}`,
671
+ foldHover: brightCyan,
299
672
  },
300
- '& > ul > li[aria-selected]': {
301
- backgroundColor: selection,
302
- color: brightYellow,
303
- borderRadius: generalTooltip.borderRadiusSelected,
304
- border: `1px solid ${brightCyan}`,
673
+ foldPlaceholder: {
674
+ background: tooltipBackground,
675
+ foreground: brightCyan,
676
+ border: brightCyan,
677
+ borderStyle: 'solid',
305
678
  },
306
- '& > ul > li > span.cm-completionIcon': {
307
- color: brightCyan,
308
- paddingRight: generalTooltip.paddingRight,
679
+ tooltip: {
680
+ background: tooltipBackground,
681
+ foreground: base05,
682
+ border: brightCyan,
683
+ listBackground: tooltipBackground,
684
+ listBorder: `1px solid ${base04}`,
685
+ hoverBackground: 'transparent',
686
+ selectedBackground: selection,
687
+ selectedForeground: brightYellow,
688
+ selectedBorder: `1px solid ${brightCyan}`,
689
+ icon: brightCyan,
690
+ detail: brightYellow,
691
+ shadow: 'none',
309
692
  },
310
- '& > ul > li > span.cm-completionDetail': {
311
- color: brightYellow,
312
- fontStyle: 'italic',
693
+ diff: {
694
+ insertedBackground: addedBackground,
695
+ insertedForeground: brightGreen,
696
+ insertedBorder: `1px solid ${brightGreen}`,
697
+ deletedBackground: removedBackground,
698
+ deletedForeground: brightRed,
699
+ deletedBorder: `1px solid ${brightRed}`,
313
700
  },
314
- },
315
- '.cm-tooltip .cm-tooltip-arrow:before': {
316
- borderTopColor: 'transparent',
317
- borderBottomColor: 'transparent',
318
- },
319
- '.cm-tooltip .cm-tooltip-arrow:after': {
320
- borderTopColor: brightCyan,
321
- borderBottomColor: brightCyan,
322
- },
323
- // Diagnostics styling
324
- '.cm-diagnostic': {
325
- '&-error': {
326
- borderLeft: `4px solid ${brightRed}`,
327
- backgroundColor: '#33000020',
701
+ diagnostic: {
702
+ error: brightRed,
703
+ warning: brightYellow,
704
+ info: brightCyan,
705
+ hint: brightCyan,
706
+ errorBackground: '#33000020',
707
+ warningBackground: '#33330020',
708
+ infoBackground: '#00333320',
709
+ borderWidth: '4px',
710
+ underlineWidth: '3px',
328
711
  },
329
- '&-warning': {
330
- borderLeft: `4px solid ${diagnosticWarning}`,
331
- backgroundColor: '#33330020',
712
+ scrollbar: {
713
+ track: base00,
714
+ trackBorder: `1px solid ${base04}`,
715
+ thumb: base04,
716
+ thumbBorder: `2px solid ${base05}`,
717
+ thumbHover: brightCyan,
718
+ thumbHoverShadow: 'none',
332
719
  },
333
- '&-info': {
334
- borderLeft: `4px solid ${linkColor}`,
335
- backgroundColor: '#00333320',
720
+ focusRing: `0 0 0 2px ${base00}, 0 0 0 5px ${brightCyan}`,
721
+ outlineWidth: '2px',
722
+ merge: {
723
+ backgroundColor: base00,
724
+ borderColor: brightCyan,
725
+ buttonColor: brightCyan,
726
+ buttonHoverColor: brightYellow,
336
727
  },
337
728
  },
338
- '.cm-lintPoint-error': {
339
- borderBottom: `3px wavy ${brightRed}`,
340
- },
341
- '.cm-lintPoint-warning': {
342
- borderBottom: `3px wavy ${diagnosticWarning}`,
343
- },
344
- // Matching brackets
345
- '.cm-matchingBracket': {
346
- backgroundColor: activeBracketBg,
347
- outline: `2px solid ${activeBracketBorder}`,
348
- borderRadius: generalMatching.borderRadius,
349
- },
350
- '.cm-nonmatchingBracket': {
351
- backgroundColor: '#33000050',
352
- outline: `2px solid ${invalid}`,
353
- borderRadius: generalMatching.borderRadius,
354
- },
355
- // Selection matches
356
- '.cm-selectionMatch': {
357
- backgroundColor: selectionMatch,
358
- outline: `2px solid ${brightCyan}50`,
359
- borderRadius: generalMatching.borderRadius,
360
- },
361
- // Fold placeholder
362
- '.cm-foldPlaceholder': {
363
- backgroundColor: tooltipBackground,
364
- color: brightCyan,
365
- border: `2px solid ${brightCyan}`,
366
- borderRadius: generalPlaceholder.borderRadius,
367
- padding: generalPlaceholder.padding,
368
- margin: generalPlaceholder.margin,
369
- },
370
- // Focus outline
371
- '&.cm-focused': {
372
- outline: `3px solid ${brightCyan}`,
373
- outlineOffset: '2px',
374
- },
375
- // Scrollbars
376
- '& .cm-scroller::-webkit-scrollbar': {
377
- width: generalScroller.width,
378
- height: generalScroller.height,
379
- },
380
- '& .cm-scroller::-webkit-scrollbar-track': {
381
- background: darkBackground,
382
- border: `1px solid ${base04}`,
383
- },
384
- '& .cm-scroller::-webkit-scrollbar-thumb': {
385
- backgroundColor: base04,
386
- border: `2px solid ${base05}`,
387
- borderRadius: generalScroller.borderRadius,
388
- },
389
- '& .cm-scroller::-webkit-scrollbar-thumb:hover': {
390
- backgroundColor: brightCyan,
391
- },
392
- // Ghost text
393
- '.cm-ghostText': {
394
- opacity: '0.7',
395
- color: base03,
396
- },
397
- }, { dark: true });
398
- /**
399
- * Enhanced syntax highlighting for High Contrast Dark theme
400
- */
401
- const highContrastDarkHighlightStyle = language.HighlightStyle.define([
402
- // Keywords and control flow
403
- { tag: highlight.tags.keyword, color: brightMagenta, fontWeight: 'bold' },
404
- { tag: highlight.tags.controlKeyword, color: brightMagenta, fontWeight: 'bold' },
405
- { tag: highlight.tags.moduleKeyword, color: brightMagenta, fontWeight: 'bold' },
406
- // Names and variables
407
- { tag: [highlight.tags.name, highlight.tags.deleted, highlight.tags.character, highlight.tags.macroName], color: base05 },
408
- { tag: [highlight.tags.variableName], color: base05 },
409
- { tag: [highlight.tags.propertyName], color: brightCyan, fontStyle: 'normal' },
410
- // Classes and types
411
- { tag: [highlight.tags.typeName], color: brightYellow },
412
- { tag: [highlight.tags.className], color: brightYellow, fontStyle: 'italic' },
413
- { tag: [highlight.tags.namespace], color: brightOrange, fontStyle: 'italic' },
414
- // Operators and punctuation
415
- { tag: [highlight.tags.operator, highlight.tags.operatorKeyword], color: brightCyan },
416
- { tag: [highlight.tags.bracket], color: brightYellow },
417
- { tag: [highlight.tags.brace], color: brightCyan },
418
- { tag: [highlight.tags.punctuation], color: base05 },
419
- // Functions and parameters
420
- { tag: [highlight.tags.function(highlight.tags.variableName), highlight.tags.labelName], color: brightBlue },
421
- { tag: [highlight.tags.definition(highlight.tags.function(highlight.tags.variableName))], color: brightBlue },
422
- { tag: [highlight.tags.definition(highlight.tags.variableName)], color: brightOrange },
423
- // Constants and literals
424
- { tag: highlight.tags.number, color: brightOrange },
425
- { tag: highlight.tags.changed, color: brightYellow },
426
- { tag: highlight.tags.annotation, color: brightRed, fontStyle: 'italic' },
427
- { tag: highlight.tags.modifier, color: brightPurple, fontStyle: 'italic' },
428
- { tag: highlight.tags.self, color: brightRed },
429
- {
430
- tag: [highlight.tags.color, highlight.tags.constant(highlight.tags.name), highlight.tags.standard(highlight.tags.name)],
431
- color: brightOrange,
432
- },
433
- { tag: [highlight.tags.atom, highlight.tags.bool, highlight.tags.special(highlight.tags.variableName)], color: brightOrange },
434
- // Strings and regex
435
- { tag: [highlight.tags.processingInstruction, highlight.tags.inserted], color: brightGreen },
436
- { tag: [highlight.tags.special(highlight.tags.string), highlight.tags.regexp], color: brightMagenta },
437
- { tag: highlight.tags.string, color: brightGreen },
438
- // Punctuation and structure
439
- { tag: highlight.tags.definition(highlight.tags.typeName), color: brightYellow, fontWeight: 'bold' },
440
- { tag: [highlight.tags.definition(highlight.tags.name), highlight.tags.separator], color: brightCyan },
441
- // Comments and documentation
442
- { tag: highlight.tags.meta, color: base03 },
443
- { tag: highlight.tags.comment, fontStyle: 'italic', color: base03 },
444
- { tag: highlight.tags.docComment, fontStyle: 'italic', color: base03 },
445
- // HTML/XML elements
446
- { tag: [highlight.tags.tagName], color: brightMagenta },
447
- { tag: [highlight.tags.attributeName], color: brightYellow },
448
- // Markdown and text formatting
449
- { tag: [highlight.tags.heading], fontWeight: 'bold', color: brightMagenta },
450
- { tag: [highlight.tags.strong], fontWeight: 'bold', color: brightOrange },
451
- { tag: [highlight.tags.emphasis], fontStyle: 'italic', color: brightMagenta },
452
- // Links and URLs
453
- {
454
- tag: [highlight.tags.link],
455
- color: visitedLinkColor,
456
- fontWeight: '500',
457
- textDecoration: 'underline',
458
- textUnderlinePosition: 'under',
459
- },
460
- {
461
- tag: [highlight.tags.url],
462
- color: linkColor,
463
- textDecoration: 'underline',
464
- textUnderlineOffset: '2px',
465
- },
466
- // Special states
467
- {
468
- tag: [highlight.tags.invalid],
469
- color: brightRed,
470
- textDecoration: 'underline wavy',
471
- borderBottom: `2px wavy ${brightRed}`,
729
+ syntax: {
730
+ keyword: { color: brightMagenta, fontWeight: 'bold' },
731
+ definitionKeyword: { color: brightMagenta },
732
+ modifier: { color: brightPurple, fontStyle: 'italic' },
733
+ separator: { color: brightCyan },
734
+ operator: { color: brightCyan },
735
+ punctuation: { color: base05 },
736
+ bracket: { color: brightYellow },
737
+ angleBracket: { color: brightCyan },
738
+ brace: { color: brightCyan },
739
+ name: { color: base05 },
740
+ localVariable: { color: brightOrange },
741
+ variableDefinition: { color: brightOrange },
742
+ nameDefinition: { color: brightCyan },
743
+ function: { color: brightBlue },
744
+ self: { color: brightRed },
745
+ label: { color: brightBlue },
746
+ property: { color: brightCyan, fontStyle: 'normal' },
747
+ type: { color: brightYellow },
748
+ typeDefinition: { color: brightYellow, fontWeight: 'bold' },
749
+ className: { color: brightYellow, fontStyle: 'italic' },
750
+ namespace: { color: brightOrange, fontStyle: 'italic' },
751
+ tag: { color: brightMagenta },
752
+ attribute: { color: brightYellow },
753
+ content: { color: base05 },
754
+ string: { color: brightGreen },
755
+ regexp: { color: brightMagenta },
756
+ number: { color: brightOrange },
757
+ constant: { color: brightOrange },
758
+ comment: { fontStyle: 'italic', color: base03 },
759
+ meta: { color: base03 },
760
+ processingInstruction: { color: brightGreen },
761
+ annotation: { color: brightRed, fontStyle: 'italic' },
762
+ heading: { fontWeight: 'bold', color: brightMagenta },
763
+ headingLevel: { color: brightMagenta },
764
+ list: { color: brightMagenta },
765
+ quote: { color: brightPurple },
766
+ monospace: { color: brightBlue, fontStyle: 'italic' },
767
+ contentSeparator: { color: brightPurple },
768
+ link: {
769
+ color: brightMagenta,
770
+ fontWeight: '500',
771
+ textDecoration: 'underline',
772
+ textUnderlinePosition: 'under',
773
+ },
774
+ url: { color: brightCyan, textDecoration: 'underline', textUnderlineOffset: '2px' },
775
+ emphasis: { fontStyle: 'italic', color: brightMagenta },
776
+ strong: { fontWeight: 'bold', color: brightOrange },
777
+ strikethrough: { color: brightRed, textDecoration: 'line-through' },
778
+ invalid: {
779
+ color: brightRed,
780
+ textDecoration: 'underline wavy',
781
+ borderBottom: `2px wavy ${brightRed}`,
782
+ },
783
+ inserted: { color: brightGreen },
784
+ deleted: { color: brightRed },
785
+ changed: { color: brightYellow },
472
786
  },
473
- { tag: [highlight.tags.strikethrough], color: brightRed, textDecoration: 'line-through' },
474
- // Enhanced syntax highlighting
475
- { tag: highlight.tags.constant(highlight.tags.name), color: brightOrange },
476
- { tag: highlight.tags.deleted, color: brightRed },
477
- { tag: highlight.tags.squareBracket, color: brightYellow },
478
- { tag: highlight.tags.angleBracket, color: brightCyan },
479
- // Additional specific styles
480
- { tag: highlight.tags.monospace, color: brightBlue, fontStyle: 'italic' },
481
- { tag: [highlight.tags.contentSeparator], color: brightPurple },
482
- { tag: highlight.tags.quote, color: brightPurple },
483
- ]);
787
+ });
484
788
  /**
485
789
  * Combined High Contrast Dark theme extension
486
790
  */
487
- const highContrastDark = [
488
- highContrastDarkTheme,
489
- language.syntaxHighlighting(highContrastDarkHighlightStyle),
490
- ];
791
+ const highContrastDark = theme.extension;
491
792
  /**
492
793
  * High Contrast Dark merge revert styles configuration
493
794
  */
494
- const highContrastDarkMergeStyles = {
495
- backgroundColor: darkBackground,
496
- borderColor: brightCyan,
497
- buttonColor: brightCyan,
498
- buttonHoverColor: brightYellow,
499
- };
795
+ const highContrastDarkMergeStyles = theme.mergeStyles;
500
796
 
501
797
  exports.applyMergeRevertStyles = applyMergeRevertStyles;
502
798
  exports.highContrastDark = highContrastDark;