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