@fsegurai/codemirror-theme-solarized-dark 6.2.5 → 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 +670 -380
  3. package/dist/index.js +670 -380
  4. package/package.json +12 -3
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var view = require('@codemirror/view');
4
3
  var language = require('@codemirror/language');
4
+ var view = require('@codemirror/view');
5
5
  var highlight = require('@lezer/highlight');
6
6
 
7
7
  // Helper module for styling options
@@ -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
  * Enhanced Solarized Dark theme color definitions
111
598
  * ---------------------------------------------
@@ -114,408 +601,211 @@ function applyMergeRevertStyles(styles) {
114
601
  // Base colors from Solarized palette
115
602
  const base00 = '#002b36', // Background - dark blue
116
603
  base01 = '#073642', // Lighter background (popups, statuslines)
117
- base02 = '#586e75', // Selection background
604
+ base02 = '#8ba2aa', // Selection background
118
605
  base03 = '#657b83', // Comments, invisibles
119
- base04 = '#839496', // Body text
120
- base05 = '#93a1a1', // Default foreground
606
+ base04 = '#91a2a4', // Body text
607
+ base05 = '#a0afaf', // Default foreground
121
608
  base06 = '#eee8d5', // Light foreground
122
609
  base07 = '#fdf6e3', // Light background
123
610
  // Accent colors from Solarized palette
124
- base08 = '#dc322f', // Red
125
- base09 = '#cb4b16', // Orange
126
- base0A = '#b58900', // Yellow
127
- base0B = '#859900', // Green
128
- base0C = '#2aa198', // Cyan
129
- base0D = '#268bd2', // Blue
130
- base0E = '#6c71c4', // Violet
131
- base0F = '#d33682'; // Magenta
611
+ base08 = '#fb7569', // Red
612
+ base09 = '#fb7748', // Orange
613
+ base0A = '#c49823', // Yellow
614
+ base0B = '#93a823', // Green
615
+ base0C = '#3cafa5', // Cyan
616
+ base0D = '#45a5ee', // Blue
617
+ base0E = '#9097ed', // Violet
618
+ base0F = '#fd6baa'; // Magenta
132
619
  // UI specific colors
133
- const invalid = '#d30102', // Bright red for errors
620
+ const invalid = '#fb7565', // Bright red for errors
134
621
  darkBackground = '#00252f', // Darker background for panels
135
622
  highlightBackground = '#99eeff0f', // Active line highlight
136
- background = base00, // Main editor background
137
- tooltipBackground = base01, // Tooltip background
138
623
  selection = '#02B8FF3F', // Selection background with opacity
139
624
  selectionMatch = '#586e7580', // Selection match with opacity
140
- cursor = base04, // Cursor color
141
- activeBracketBg = '#586e7540', // Active bracket background with opacity
142
- activeBracketBorder = base0D, // Active bracket border - blue
143
- diagnosticWarning = base0A, // Warning color - yellow
144
- linkColor = base0D; // Link color - blue
625
+ activeBracketBg = '#586e7540'; // Active bracket background with opacity
145
626
  // Diff/merge specific colors
146
627
  const addedBackground = '#2aa19820', // Solarized cyan with transparency for insertions
147
- removedBackground = '#dc322f20', // Solarized red with transparency for deletions
148
- addedText = '#859900', // Solarized green for added text
149
- removedText = '#dc322f'; // Solarized red for removed text
150
- /**
151
- * Enhanced editor theme styles for Solarized Dark
152
- */
153
- const solarizedDarkTheme = view.EditorView.theme({
154
- // Base editor styles
155
- '&': {
156
- color: base05,
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: '#586e7599',
185
- outline: `1px solid ${base0D}`,
186
- color: base06,
187
- borderRadius: generalSearchField.borderRadius,
188
- '& span': {
189
- color: base06,
628
+ removedBackground = '#dc322f20'; // Solarized red with transparency for deletions
629
+ const theme = defineTheme({
630
+ dark: true,
631
+ ui: {
632
+ background: base00,
633
+ foreground: base05,
634
+ border: 'none',
635
+ cursor: base04,
636
+ cursorWidth: '2px',
637
+ cursorShadow: 'none',
638
+ fatCursor: { background: `${base04}99`, border: 'none' },
639
+ selection: '#02b8ff1d',
640
+ selectionInactive: '#02b8ff1d',
641
+ selectionForeground: null,
642
+ selectionOutline: 'none',
643
+ activeLine: '#99eeff07',
644
+ activeLineBorder: { left: 'none', right: 'none' },
645
+ ghostText: base03,
646
+ ghostTextOpacity: '0.5',
647
+ specialChar: base08,
648
+ focusRing: `0 0 0 2px ${base00}, 0 0 0 4px ${base0D}`,
649
+ outlineWidth: '1px',
650
+ searchMatch: {
651
+ background: `${base02}99`,
652
+ outline: base0D,
653
+ foreground: base06,
654
+ shadow: 'none',
655
+ selectedBackground: base0D,
656
+ selectedForeground: base07,
657
+ selectedOutline: `1px solid ${base0D}`,
658
+ selectedShadow: 'none',
190
659
  },
191
- },
192
- '.cm-searchMatch.cm-searchMatch-selected': {
193
- backgroundColor: base0D,
194
- color: base07,
195
- padding: generalSearchField.padding,
196
- '& span': {
197
- color: base07,
660
+ selectionMatch: { background: selectionMatch, outline: `${base02}50` },
661
+ matchingBracket: { background: activeBracketBg, outline: base0D, shadow: 'none' },
662
+ nonMatchingBracket: { background: `${base08}40`, outline: invalid },
663
+ panel: {
664
+ background: darkBackground,
665
+ foreground: base04,
666
+ border: base01,
667
+ borderWidth: '1px',
668
+ outline: 'none',
669
+ shadow: 'none',
670
+ buttonBackground: base01,
671
+ buttonForeground: base05,
672
+ buttonBorder: 'none',
673
+ buttonHoverBackground: highlightBackground,
674
+ buttonHoverForeground: base05,
675
+ buttonHoverBorder: 'none',
676
+ buttonHoverShadow: 'none',
677
+ inputBackground: base00,
678
+ inputBorder: `1px solid ${base01}`,
198
679
  },
199
- },
200
- '.cm-search.cm-panel.cm-textfield': {
201
- color: base05,
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 ${base01}`,
213
- },
214
- '.cm-panels.cm-panels-bottom': {
215
- borderTop: `1px solid ${base01}`,
216
- },
217
- '.cm-panel button': {
218
- backgroundColor: tooltipBackground,
219
- color: base05,
220
- border: generalPanel.border,
221
- borderRadius: generalPanel.borderRadius,
222
- padding: generalPanel.padding,
223
- },
224
- '.cm-panel button:hover': {
225
- backgroundColor: highlightBackground,
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: base02,
237
- border: generalGutter.border,
238
- borderRight: `1px solid ${base01}`,
239
- paddingRight: generalGutter.paddingRight,
240
- },
241
- '.cm-activeLineGutter': {
242
- backgroundColor: base01,
243
- color: base05,
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: base02,
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 ${base02}`,
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',
680
+ gutter: {
681
+ background: darkBackground,
682
+ foreground: base02,
683
+ border: base01,
684
+ activeBackground: base01,
685
+ activeForeground: base05,
686
+ activeFontWeight: '500',
687
+ activeBorder: 'none',
688
+ foldHover: base04,
312
689
  },
313
- '& > ul > li': {
314
- padding: generalTooltip.padding,
315
- lineHeight: generalTooltip.lineHeight,
690
+ foldPlaceholder: { background: base01, foreground: base03, border: `${base02}70`, borderStyle: 'dotted' },
691
+ tooltip: {
692
+ background: base01,
693
+ foreground: base05,
694
+ border: base02,
695
+ shadow: '0 2px 8px rgba(0, 0, 0, 0.3)',
696
+ listBackground: base01,
697
+ listBorder: 'none',
698
+ hoverBackground: 'transparent',
699
+ selectedBackground: selection,
700
+ selectedForeground: base06,
701
+ selectedBorder: 'none',
702
+ icon: base03,
703
+ detail: base03,
316
704
  },
317
- '& > ul > li[aria-selected]': {
318
- backgroundColor: selection,
319
- color: base06,
320
- borderRadius: generalTooltip.borderRadiusSelected,
705
+ diff: {
706
+ insertedBackground: addedBackground,
707
+ insertedForeground: base0B,
708
+ insertedBorder: `1px solid ${base0B}40`,
709
+ deletedBackground: removedBackground,
710
+ deletedForeground: base08,
711
+ deletedBorder: `1px solid ${base08}40`,
321
712
  },
322
- '& > ul > li > span.cm-completionIcon': {
323
- color: base03,
324
- paddingRight: generalTooltip.paddingRight,
713
+ diagnostic: {
714
+ error: base08,
715
+ warning: base0A,
716
+ info: base0D,
717
+ hint: base0D,
718
+ errorBackground: 'transparent',
719
+ warningBackground: 'transparent',
720
+ infoBackground: 'transparent',
721
+ borderWidth: '3px',
722
+ underlineWidth: '2px',
325
723
  },
326
- '& > ul > li > span.cm-completionDetail': {
327
- color: base03,
328
- fontStyle: 'italic',
724
+ scrollbar: {
725
+ track: darkBackground,
726
+ trackBorder: 'none',
727
+ thumb: base01,
728
+ thumbBorder: `3px solid ${darkBackground}`,
729
+ thumbHover: base02,
730
+ thumbHoverShadow: 'none',
329
731
  },
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 ${base08}`,
732
+ merge: {
733
+ backgroundColor: darkBackground,
734
+ borderColor: base02,
735
+ buttonColor: base05,
736
+ buttonHoverColor: base01,
343
737
  },
344
- '&-warning': {
345
- borderLeft: `3px solid ${diagnosticWarning}`,
738
+ },
739
+ syntax: {
740
+ keyword: { color: base0B, fontWeight: 'bold' },
741
+ definitionKeyword: { color: base0B },
742
+ modifier: { color: base0F, fontStyle: 'italic' },
743
+ separator: { color: base0C },
744
+ operator: { color: base0E },
745
+ punctuation: { color: base04 },
746
+ bracket: { color: base0F },
747
+ angleBracket: { color: base02 },
748
+ squareBracket: { color: base08 },
749
+ name: { color: base0C },
750
+ variable: { color: base05 },
751
+ localVariable: { color: base0C },
752
+ variableDefinition: { color: base0C },
753
+ function: { color: base0D },
754
+ self: { color: base0F },
755
+ label: { color: base0F },
756
+ property: { color: base0C, fontStyle: 'normal' },
757
+ type: { color: base09 },
758
+ typeDefinition: { color: base09, fontWeight: 'bold' },
759
+ className: { color: base09, fontStyle: 'italic' },
760
+ namespace: { color: base0F, fontStyle: 'italic' },
761
+ tag: { color: base0D },
762
+ attribute: { color: base05 },
763
+ content: { color: base05 },
764
+ string: { color: base0A },
765
+ regexp: { color: invalid },
766
+ constantName: { color: base0A },
767
+ standardName: { color: base0A },
768
+ number: { color: base0F },
769
+ constant: { color: base0F },
770
+ comment: { fontStyle: 'italic', color: base02 },
771
+ meta: { color: base08 },
772
+ processingInstruction: { color: base0B },
773
+ annotation: { color: invalid, fontStyle: 'italic' },
774
+ heading: { fontWeight: 'bold', color: base0A },
775
+ headingLevel: { color: base06 },
776
+ heading1: { color: base07 },
777
+ list: { color: base0A },
778
+ quote: { color: base0B },
779
+ monospace: { color: base05 },
780
+ contentSeparator: { color: base0A },
781
+ link: {
782
+ color: base0C,
783
+ fontWeight: '500',
784
+ textDecoration: 'underline',
785
+ textUnderlinePosition: 'under',
346
786
  },
347
- '&-info': {
348
- borderLeft: `3px solid ${linkColor}`,
787
+ url: { color: base0A, textDecoration: 'underline', textUnderlineOffset: '2px' },
788
+ emphasis: { fontStyle: 'italic', color: base0B },
789
+ strong: { fontWeight: 'bold', color: base06 },
790
+ strikethrough: { color: invalid, textDecoration: 'line-through' },
791
+ invalid: {
792
+ color: base02,
793
+ textDecoration: 'underline wavy',
794
+ borderBottom: `1px dotted ${base08}`,
349
795
  },
796
+ inserted: { color: base0B },
797
+ deleted: { color: base08 },
798
+ changed: { color: base0F },
350
799
  },
351
- '.cm-lintPoint-error': {
352
- borderBottom: `2px wavy ${base08}`,
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: `${base08}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 ${base02}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 ${base0D}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: base01,
398
- borderRadius: generalScroller.borderRadius,
399
- border: `3px solid ${darkBackground}`,
400
- },
401
- '& .cm-scroller::-webkit-scrollbar-thumb:hover': {
402
- backgroundColor: base02,
403
- },
404
- // Ghost text
405
- '.cm-ghostText': {
406
- opacity: '0.5',
407
- color: base03,
408
- },
409
- }, { dark: true });
410
- /**
411
- * Enhanced syntax highlighting for Solarized Dark theme
412
- */
413
- const solarizedDarkHighlightStyle = language.HighlightStyle.define([
414
- // Keywords and control flow
415
- { tag: highlight.tags.keyword, color: base0B, fontWeight: 'bold' },
416
- { tag: highlight.tags.controlKeyword, color: base0B, fontWeight: 'bold' },
417
- { tag: highlight.tags.moduleKeyword, color: base0B, fontWeight: 'bold' },
418
- // Names and variables
419
- { tag: [highlight.tags.name, highlight.tags.deleted, highlight.tags.character, highlight.tags.macroName], color: base0C },
420
- { tag: [highlight.tags.variableName], color: base05 },
421
- { tag: [highlight.tags.propertyName], color: base0C, fontStyle: 'normal' },
422
- // Classes and types
423
- { tag: [highlight.tags.typeName], color: base09 },
424
- { tag: [highlight.tags.className], color: base09, fontStyle: 'italic' },
425
- { tag: [highlight.tags.namespace], color: base0F, fontStyle: 'italic' },
426
- // Operators and punctuation
427
- { tag: [highlight.tags.operator, highlight.tags.operatorKeyword], color: base0E },
428
- { tag: [highlight.tags.bracket], color: base0F },
429
- { tag: [highlight.tags.brace], color: base0F },
430
- { tag: [highlight.tags.punctuation], color: base04 },
431
- // Functions and parameters
432
- { tag: [highlight.tags.function(highlight.tags.variableName)], color: base0D },
433
- { tag: [highlight.tags.labelName], color: base0F },
434
- { tag: [highlight.tags.definition(highlight.tags.function(highlight.tags.variableName))], color: base0D },
435
- { tag: [highlight.tags.definition(highlight.tags.variableName)], color: base0C },
436
- // Constants and literals
437
- { tag: highlight.tags.number, color: base0F },
438
- { tag: highlight.tags.changed, color: base0F },
439
- { tag: highlight.tags.annotation, color: invalid, fontStyle: 'italic' },
440
- { tag: highlight.tags.modifier, color: base0F, fontStyle: 'italic' },
441
- { tag: highlight.tags.self, color: base0F },
442
- {
443
- tag: [highlight.tags.color, highlight.tags.constant(highlight.tags.name), highlight.tags.standard(highlight.tags.name)],
444
- color: base0A,
445
- },
446
- { tag: [highlight.tags.atom, highlight.tags.bool, highlight.tags.special(highlight.tags.variableName)], color: base0F },
447
- // Strings and regex
448
- { tag: [highlight.tags.processingInstruction, highlight.tags.inserted], color: base0B },
449
- { tag: [highlight.tags.special(highlight.tags.string), highlight.tags.regexp], color: invalid },
450
- { tag: highlight.tags.string, color: base0A },
451
- // Punctuation and structure
452
- { tag: highlight.tags.definition(highlight.tags.typeName), color: base09, fontWeight: 'bold' },
453
- { tag: [highlight.tags.definition(highlight.tags.name), highlight.tags.separator], color: base0C },
454
- // Comments and documentation
455
- { tag: highlight.tags.meta, color: base08 },
456
- { tag: highlight.tags.comment, fontStyle: 'italic', color: base02 },
457
- { tag: highlight.tags.docComment, fontStyle: 'italic', color: base02 },
458
- // HTML/XML elements
459
- { tag: [highlight.tags.tagName], color: base0D },
460
- { tag: [highlight.tags.attributeName], color: base05 },
461
- // Markdown and text formatting
462
- { tag: [highlight.tags.heading], fontWeight: 'bold', color: base0A },
463
- { tag: highlight.tags.heading1, color: base07 },
464
- { tag: highlight.tags.heading2, color: base06 },
465
- { tag: highlight.tags.heading3, color: base06 },
466
- { tag: highlight.tags.heading4, color: base06 },
467
- { tag: highlight.tags.heading5, color: base06 },
468
- { tag: highlight.tags.heading6, color: base06 },
469
- { tag: [highlight.tags.strong], fontWeight: 'bold', color: base06 },
470
- { tag: [highlight.tags.emphasis], fontStyle: 'italic', color: base0B },
471
- // Links and URLs
472
- {
473
- tag: [highlight.tags.link],
474
- color: base0C,
475
- fontWeight: '500',
476
- textDecoration: 'underline',
477
- textUnderlinePosition: 'under',
478
- },
479
- {
480
- tag: [highlight.tags.url],
481
- color: base0A,
482
- textDecoration: 'underline',
483
- textUnderlineOffset: '2px',
484
- },
485
- // Special states
486
- {
487
- tag: [highlight.tags.invalid],
488
- color: base02,
489
- textDecoration: 'underline wavy',
490
- borderBottom: `1px dotted ${base08}`,
491
- },
492
- { tag: [highlight.tags.strikethrough], color: invalid, textDecoration: 'line-through' },
493
- // Enhanced syntax highlighting
494
- { tag: highlight.tags.constant(highlight.tags.name), color: base0A },
495
- { tag: highlight.tags.deleted, color: base08 },
496
- { tag: highlight.tags.squareBracket, color: base08 },
497
- { tag: highlight.tags.angleBracket, color: base02 },
498
- // Additional specific styles
499
- { tag: highlight.tags.monospace, color: base05 },
500
- { tag: [highlight.tags.contentSeparator], color: base0A },
501
- { tag: highlight.tags.quote, color: base0B },
502
- ]);
800
+ });
503
801
  /**
504
802
  * Combined Solarized Dark theme extension
505
803
  */
506
- const solarizedDark = [
507
- solarizedDarkTheme,
508
- language.syntaxHighlighting(solarizedDarkHighlightStyle),
509
- ];
804
+ const solarizedDark = theme.extension;
510
805
  /**
511
806
  * Solarized Dark merge revert styles configuration
512
807
  */
513
- const solarizedDarkMergeStyles = {
514
- backgroundColor: darkBackground,
515
- borderColor: base02,
516
- buttonColor: base05,
517
- buttonHoverColor: base01,
518
- };
808
+ const solarizedDarkMergeStyles = theme.mergeStyles;
519
809
 
520
810
  exports.applyMergeRevertStyles = applyMergeRevertStyles;
521
811
  exports.solarizedDark = solarizedDark;