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