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