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