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