@fsegurai/codemirror-theme-high-contrast-dark 6.0.0 → 6.0.1

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 fsegurai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <img alt="CodeMirror 6 Themes Logo" src="https://raw.githubusercontent.com/fsegurai/codemirror-themes/main/demo/public/codemirror-themes.png">
2
+ <img alt="CodeMirror 6 Themes Logo" src="https://raw.githubusercontent.com/fsegurai/codemirror-themes/main/demo/public/codemirror-themes.svg">
3
3
  </p>
4
4
 
5
5
  <p align="center">
@@ -31,6 +31,7 @@
31
31
  - [Installation](#installation)
32
32
  - [@fsegurai/codemirror-theme-high-contrast-dark](#@fsegurai/codemirror-theme-high-contrast-dark)
33
33
  - [Using Theme](#using-theme)
34
+ - [More Resources](#more-resources)
34
35
  - [Available Themes](#available-themes)
35
36
  - [Demo Application](#demo-application)
36
37
  - [License](#license)
@@ -89,6 +90,7 @@ Read the [CodeMirror documentation](https://codemirror.net/6/examples/styling/)
89
90
  | High Contrast Light | [@fsegurai/codemirror-theme-high-contrast-light](https://www.npmjs.com/package/@fsegurai/codemirror-theme-high-contrast-light) | ![npm](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-high-contrast-light) |
90
91
  | Material Dark | [@fsegurai/codemirror-theme-material-dark](https://www.npmjs.com/package/@fsegurai/codemirror-theme-material-dark) | ![npm](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-material-dark) |
91
92
  | Material Light | [@fsegurai/codemirror-theme-material-light](https://www.npmjs.com/package/@fsegurai/codemirror-theme-material-light) | ![npm](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-material-light) |
93
+ | Material Ocean | [@fsegurai/codemirror-theme-material-ocean](https://www.npmjs.com/package/@fsegurai/codemirror-theme-material-ocean) | ![npm](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-material-ocean) |
92
94
  | Monokai | [@fsegurai/codemirror-theme-monokai](https://www.npmjs.com/package/@fsegurai/codemirror-theme-monokai) | ![npm](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-monokai) |
93
95
  | Nord | [@fsegurai/codemirror-theme-nord](https://www.npmjs.com/package/@fsegurai/codemirror-theme-nord) | ![npm](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-nord) |
94
96
  | Palenight | [@fsegurai/codemirror-theme-palenight](https://www.npmjs.com/package/@fsegurai/codemirror-theme-palenight) | ![npm](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-palenight) |
package/dist/index.cjs CHANGED
@@ -14,7 +14,7 @@ const generalDiff = {
14
14
  insertedTextDecoration: 'none',
15
15
  deletedTextDecoration: 'line-through',
16
16
  insertedLinePadding: '1px 3px',
17
- borderRadious: '3px'};
17
+ borderRadius: '3px'};
18
18
  const generalGutter = {
19
19
  border: 'none',
20
20
  paddingRight: '8px',
@@ -247,7 +247,7 @@ const highContrastDarkTheme = view.EditorView.theme({
247
247
  backgroundColor: addedBackground,
248
248
  color: addedText,
249
249
  padding: generalDiff.insertedLinePadding,
250
- borderRadius: generalDiff.borderRadious,
250
+ borderRadius: generalDiff.borderRadius,
251
251
  border: `1px solid ${addedText}`,
252
252
  },
253
253
  'ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))': {
@@ -255,7 +255,7 @@ const highContrastDarkTheme = view.EditorView.theme({
255
255
  backgroundColor: `${addedBackground} !important`,
256
256
  color: addedText,
257
257
  padding: generalDiff.insertedLinePadding,
258
- borderRadius: generalDiff.borderRadious,
258
+ borderRadius: generalDiff.borderRadius,
259
259
  border: `1px solid ${addedText}`,
260
260
  },
261
261
  'ins.cm-insertedLine .cm-changedText': {
@@ -266,7 +266,7 @@ const highContrastDarkTheme = view.EditorView.theme({
266
266
  backgroundColor: removedBackground,
267
267
  color: removedText,
268
268
  padding: generalDiff.insertedLinePadding,
269
- borderRadius: generalDiff.borderRadious,
269
+ borderRadius: generalDiff.borderRadius,
270
270
  border: `1px solid ${removedText}`,
271
271
  },
272
272
  'del.cm-deletedLine, del, del:not(:has(.cm-deletedText))': {
@@ -274,7 +274,7 @@ const highContrastDarkTheme = view.EditorView.theme({
274
274
  backgroundColor: `${removedBackground} !important`,
275
275
  color: removedText,
276
276
  padding: generalDiff.insertedLinePadding,
277
- borderRadius: generalDiff.borderRadious,
277
+ borderRadius: generalDiff.borderRadius,
278
278
  border: `1px solid ${removedText}`,
279
279
  },
280
280
  'del .cm-deletedText, del .cm-changedText': {
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ const generalDiff = {
12
12
  insertedTextDecoration: 'none',
13
13
  deletedTextDecoration: 'line-through',
14
14
  insertedLinePadding: '1px 3px',
15
- borderRadious: '3px'};
15
+ borderRadius: '3px'};
16
16
  const generalGutter = {
17
17
  border: 'none',
18
18
  paddingRight: '8px',
@@ -245,7 +245,7 @@ const highContrastDarkTheme = /*@__PURE__*/EditorView.theme({
245
245
  backgroundColor: addedBackground,
246
246
  color: addedText,
247
247
  padding: generalDiff.insertedLinePadding,
248
- borderRadius: generalDiff.borderRadious,
248
+ borderRadius: generalDiff.borderRadius,
249
249
  border: `1px solid ${addedText}`,
250
250
  },
251
251
  'ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))': {
@@ -253,7 +253,7 @@ const highContrastDarkTheme = /*@__PURE__*/EditorView.theme({
253
253
  backgroundColor: `${addedBackground} !important`,
254
254
  color: addedText,
255
255
  padding: generalDiff.insertedLinePadding,
256
- borderRadius: generalDiff.borderRadious,
256
+ borderRadius: generalDiff.borderRadius,
257
257
  border: `1px solid ${addedText}`,
258
258
  },
259
259
  'ins.cm-insertedLine .cm-changedText': {
@@ -264,7 +264,7 @@ const highContrastDarkTheme = /*@__PURE__*/EditorView.theme({
264
264
  backgroundColor: removedBackground,
265
265
  color: removedText,
266
266
  padding: generalDiff.insertedLinePadding,
267
- borderRadius: generalDiff.borderRadious,
267
+ borderRadius: generalDiff.borderRadius,
268
268
  border: `1px solid ${removedText}`,
269
269
  },
270
270
  'del.cm-deletedLine, del, del:not(:has(.cm-deletedText))': {
@@ -272,7 +272,7 @@ const highContrastDarkTheme = /*@__PURE__*/EditorView.theme({
272
272
  backgroundColor: `${removedBackground} !important`,
273
273
  color: removedText,
274
274
  padding: generalDiff.insertedLinePadding,
275
- borderRadius: generalDiff.borderRadious,
275
+ borderRadius: generalDiff.borderRadius,
276
276
  border: `1px solid ${removedText}`,
277
277
  },
278
278
  'del .cm-deletedText, del .cm-changedText': {
package/package.json CHANGED
@@ -1,20 +1,16 @@
1
1
  {
2
2
  "name": "@fsegurai/codemirror-theme-high-contrast-dark",
3
+ "version": "6.0.1",
3
4
  "description": "High Contrast Dark theme for the CodeMirror editor",
4
- "version": "6.0.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
7
+ "module": "dist/index.js",
8
+ "types": "dist/index.d.ts",
7
9
  "exports": {
8
10
  "import": "./dist/index.js",
9
11
  "require": "./dist/index.cjs"
10
12
  },
11
- "types": "dist/index.d.ts",
12
- "module": "dist/index.js",
13
13
  "sideEffects": false,
14
- "scripts": {
15
- "test": "cm-runtests",
16
- "prepare": "cm-buildhelper src/index.ts"
17
- },
18
14
  "keywords": [
19
15
  "editor",
20
16
  "diff",
@@ -34,6 +30,10 @@
34
30
  "url": "https://www.fsegurai.com/"
35
31
  },
36
32
  "license": "MIT",
33
+ "scripts": {
34
+ "pkg:build": "cm-buildhelper src/index.ts",
35
+ "pkg:test": "cm-runtests"
36
+ },
37
37
  "peerDependencies": {
38
38
  "@lezer/highlight": "^1.0.0",
39
39
  "@codemirror/language": "^6.0.0",
package/src/index.ts DELETED
@@ -1,484 +0,0 @@
1
- import { EditorView } from '@codemirror/view';
2
- import { Extension } from '@codemirror/state';
3
- import { HighlightStyle, syntaxHighlighting } from '@codemirror/language';
4
- import { tags as t } from '@lezer/highlight';
5
-
6
- import {
7
- applyMergeRevertStyles,
8
- generalContent,
9
- generalDiff,
10
- generalGutter,
11
- generalLine,
12
- generalMatching,
13
- generalPanel,
14
- generalPlaceholder,
15
- generalScroller,
16
- generalSearchField,
17
- generalTooltip,
18
- IMergeRevertStyles,
19
- } from './utils';
20
-
21
- /**
22
- * High Contrast Dark theme color definitions
23
- * ------------------------------------------
24
- * Maximum contrast theme for accessibility
25
- */
26
-
27
- // Base colors - Pure black and white for maximum contrast
28
- const base00 = '#000000', // Background - pure black
29
- base01 = '#0a0a0a', // Darker background
30
- base02 = '#1f1f1f', // Selection background
31
- base03 = '#808080', // Comments - medium grey
32
- base04 = '#b0b0b0', // Dark grey
33
- base05 = '#ffffff', // Foreground - pure white
34
-
35
- // High contrast accent colors
36
- brightYellow = '#ffff00',
37
- brightCyan = '#00ffff',
38
- brightGreen = '#00ff00',
39
- brightRed = '#ff0000',
40
- brightMagenta = '#ff00ff',
41
- brightBlue = '#0099ff',
42
- brightOrange = '#ff9900',
43
- brightPurple = '#cc66ff';
44
-
45
- // UI specific colors
46
- const invalid = brightRed,
47
- darkBackground = base00,
48
- background = base00,
49
- tooltipBackground = '#1a1a1a',
50
- selection = '#264f78',
51
- selectionMatch = '#264f7880',
52
- cursor = brightYellow,
53
- activeBracketBg = '#1f1f1f',
54
- activeBracketBorder = brightCyan,
55
- diagnosticWarning = brightYellow,
56
- linkColor = brightCyan,
57
- visitedLinkColor = brightMagenta;
58
-
59
- // Diff/merge specific colors
60
- const addedBackground = '#00550060',
61
- removedBackground = '#55000060',
62
- addedText = brightGreen,
63
- removedText = brightRed;
64
-
65
- /**
66
- * Enhanced editor theme styles for High Contrast Dark
67
- */
68
- const highContrastDarkTheme = EditorView.theme(
69
- {
70
- // Base editor styles
71
- '&': {
72
- color: base05,
73
- backgroundColor: background,
74
- fontSize: generalContent.fontSize,
75
- fontFamily: generalContent.fontFamily,
76
- border: `1px solid ${base04}`,
77
- },
78
-
79
- // Content and cursor
80
- '.cm-content': {
81
- caretColor: cursor,
82
- lineHeight: generalContent.lineHeight,
83
- },
84
- '.cm-cursor, .cm-dropCursor': {
85
- borderLeftColor: cursor,
86
- borderLeftWidth: '3px',
87
- },
88
- '.cm-fat-cursor': {
89
- backgroundColor: cursor,
90
- color: background,
91
- border: `2px solid ${base05}`,
92
- },
93
-
94
- // Selection
95
- '&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection':
96
- {
97
- backgroundColor: '#3a5a8a',
98
- outline: `2px solid ${brightCyan}`,
99
- },
100
-
101
- // Make sure selection appears above active line
102
- '.cm-selectionLayer': {
103
- zIndex: 100,
104
- },
105
-
106
- // Search functionality
107
- '.cm-searchMatch': {
108
- backgroundColor: '#006400',
109
- outline: `2px solid ${brightGreen}`,
110
- color: base05,
111
- borderRadius: generalSearchField.borderRadius,
112
-
113
- '& span': {
114
- color: base05,
115
- },
116
- },
117
- '.cm-searchMatch.cm-searchMatch-selected': {
118
- backgroundColor: brightGreen,
119
- color: base00,
120
- padding: generalSearchField.padding,
121
- outline: `2px solid ${base05}`,
122
-
123
- '& span': {
124
- color: base00,
125
- },
126
- },
127
- '.cm-search.cm-panel.cm-textfield': {
128
- color: base05,
129
- backgroundColor: base01,
130
- border: `1px solid ${base04}`,
131
- borderRadius: generalSearchField.borderRadius,
132
- padding: generalSearchField.padding,
133
- },
134
-
135
- // Panels
136
- '.cm-panels': {
137
- backgroundColor: darkBackground,
138
- color: base05,
139
- borderRadius: '4px',
140
- border: `1px solid ${base04}`,
141
- },
142
- '.cm-panels.cm-panels-top': {
143
- borderBottom: `2px solid ${base04}`,
144
- },
145
- '.cm-panels.cm-panels-bottom': {
146
- borderTop: `2px solid ${base04}`,
147
- },
148
- '.cm-panel button': {
149
- backgroundColor: tooltipBackground,
150
- color: brightCyan,
151
- border: `1px solid ${base04}`,
152
- borderRadius: generalPanel.borderRadius,
153
- padding: generalPanel.padding,
154
- },
155
- '.cm-panel button:hover': {
156
- backgroundColor: base02,
157
- border: `1px solid ${brightCyan}`,
158
- },
159
-
160
- // Line highlighting
161
- '.cm-activeLine': {
162
- backgroundColor: '#2a2a2aa6',
163
- borderRadius: generalLine.borderRadius,
164
- borderLeft: `3px solid ${brightCyan}`,
165
- borderRight: `1px solid ${base04}`,
166
- zIndex: 1,
167
- },
168
-
169
- // Gutters
170
- '.cm-gutters': {
171
- backgroundColor: darkBackground,
172
- color: base04,
173
- border: generalGutter.border,
174
- borderRight: `2px solid ${base04}`,
175
- paddingRight: generalGutter.paddingRight,
176
- },
177
- '.cm-activeLineGutter': {
178
- backgroundColor: base02,
179
- color: brightYellow,
180
- fontWeight: 'bold',
181
- border: `1px solid ${base03}`,
182
- },
183
- '.cm-lineNumbers': {
184
- fontSize: generalGutter.fontSize,
185
- lineHeight: generalGutter.lineHeight,
186
- },
187
- '.cm-foldGutter': {
188
- fontSize: generalGutter.fontSize,
189
- lineHeight: generalGutter.lineHeight,
190
- },
191
- '.cm-foldGutter .cm-gutterElement': {
192
- color: base04,
193
- cursor: 'pointer',
194
- },
195
- '.cm-foldGutter .cm-gutterElement:hover': {
196
- color: brightCyan,
197
- },
198
-
199
- // Diff/Merge View Styles
200
- '.cm-insertedLine': {
201
- textDecoration: generalDiff.insertedTextDecoration,
202
- backgroundColor: addedBackground,
203
- color: addedText,
204
- padding: generalDiff.insertedLinePadding,
205
- borderRadius: generalDiff.borderRadious,
206
- border: `1px solid ${addedText}`,
207
- },
208
- 'ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))': {
209
- textDecoration: generalDiff.insertedTextDecoration,
210
- backgroundColor: `${addedBackground} !important`,
211
- color: addedText,
212
- padding: generalDiff.insertedLinePadding,
213
- borderRadius: generalDiff.borderRadious,
214
- border: `1px solid ${addedText}`,
215
- },
216
- 'ins.cm-insertedLine .cm-changedText': {
217
- background: 'transparent !important',
218
- },
219
-
220
- '.cm-deletedLine': {
221
- textDecoration: generalDiff.deletedTextDecoration,
222
- backgroundColor: removedBackground,
223
- color: removedText,
224
- padding: generalDiff.insertedLinePadding,
225
- borderRadius: generalDiff.borderRadious,
226
- border: `1px solid ${removedText}`,
227
- },
228
- 'del.cm-deletedLine, del, del:not(:has(.cm-deletedText))': {
229
- textDecoration: generalDiff.deletedTextDecoration,
230
- backgroundColor: `${removedBackground} !important`,
231
- color: removedText,
232
- padding: generalDiff.insertedLinePadding,
233
- borderRadius: generalDiff.borderRadious,
234
- border: `1px solid ${removedText}`,
235
- },
236
- 'del .cm-deletedText, del .cm-changedText': {
237
- background: 'transparent !important',
238
- },
239
-
240
- // Tooltips and autocomplete
241
- '.cm-tooltip': {
242
- backgroundColor: tooltipBackground,
243
- border: `2px solid ${brightCyan}`,
244
- borderRadius: generalTooltip.borderRadius,
245
- padding: generalTooltip.padding,
246
- color: base05,
247
- },
248
- '.cm-tooltip-autocomplete': {
249
- '& > ul': {
250
- backgroundColor: tooltipBackground,
251
- border: `1px solid ${base04}`,
252
- },
253
- '& > ul > li': {
254
- padding: generalTooltip.padding,
255
- lineHeight: generalTooltip.lineHeight,
256
- },
257
- '& > ul > li[aria-selected]': {
258
- backgroundColor: selection,
259
- color: brightYellow,
260
- borderRadius: generalTooltip.borderRadiusSelected,
261
- border: `1px solid ${brightCyan}`,
262
- },
263
- '& > ul > li > span.cm-completionIcon': {
264
- color: brightCyan,
265
- paddingRight: generalTooltip.paddingRight,
266
- },
267
- '& > ul > li > span.cm-completionDetail': {
268
- color: brightYellow,
269
- fontStyle: 'italic',
270
- },
271
- },
272
- '.cm-tooltip .cm-tooltip-arrow:before': {
273
- borderTopColor: 'transparent',
274
- borderBottomColor: 'transparent',
275
- },
276
- '.cm-tooltip .cm-tooltip-arrow:after': {
277
- borderTopColor: brightCyan,
278
- borderBottomColor: brightCyan,
279
- },
280
-
281
- // Diagnostics styling
282
- '.cm-diagnostic': {
283
- '&-error': {
284
- borderLeft: `4px solid ${brightRed}`,
285
- backgroundColor: '#33000020',
286
- },
287
- '&-warning': {
288
- borderLeft: `4px solid ${diagnosticWarning}`,
289
- backgroundColor: '#33330020',
290
- },
291
- '&-info': {
292
- borderLeft: `4px solid ${linkColor}`,
293
- backgroundColor: '#00333320',
294
- },
295
- },
296
- '.cm-lintPoint-error': {
297
- borderBottom: `3px wavy ${brightRed}`,
298
- },
299
- '.cm-lintPoint-warning': {
300
- borderBottom: `3px wavy ${diagnosticWarning}`,
301
- },
302
-
303
- // Matching brackets
304
- '.cm-matchingBracket': {
305
- backgroundColor: activeBracketBg,
306
- outline: `2px solid ${activeBracketBorder}`,
307
- borderRadius: generalMatching.borderRadius,
308
- },
309
- '.cm-nonmatchingBracket': {
310
- backgroundColor: '#33000050',
311
- outline: `2px solid ${invalid}`,
312
- borderRadius: generalMatching.borderRadius,
313
- },
314
-
315
- // Selection matches
316
- '.cm-selectionMatch': {
317
- backgroundColor: selectionMatch,
318
- outline: `2px solid ${brightCyan}50`,
319
- borderRadius: generalMatching.borderRadius,
320
- },
321
-
322
- // Fold placeholder
323
- '.cm-foldPlaceholder': {
324
- backgroundColor: tooltipBackground,
325
- color: brightCyan,
326
- border: `2px solid ${brightCyan}`,
327
- borderRadius: generalPlaceholder.borderRadius,
328
- padding: generalPlaceholder.padding,
329
- margin: generalPlaceholder.margin,
330
- },
331
-
332
- // Focus outline
333
- '&.cm-focused': {
334
- outline: `3px solid ${brightCyan}`,
335
- outlineOffset: '2px',
336
- },
337
-
338
- // Scrollbars
339
- '& .cm-scroller::-webkit-scrollbar': {
340
- width: generalScroller.width,
341
- height: generalScroller.height,
342
- },
343
- '& .cm-scroller::-webkit-scrollbar-track': {
344
- background: darkBackground,
345
- border: `1px solid ${base04}`,
346
- },
347
- '& .cm-scroller::-webkit-scrollbar-thumb': {
348
- backgroundColor: base04,
349
- border: `2px solid ${base05}`,
350
- borderRadius: generalScroller.borderRadius,
351
- },
352
- '& .cm-scroller::-webkit-scrollbar-thumb:hover': {
353
- backgroundColor: brightCyan,
354
- },
355
-
356
- // Ghost text
357
- '.cm-ghostText': {
358
- opacity: '0.7',
359
- color: base03,
360
- },
361
- },
362
- { dark: true },
363
- );
364
-
365
- /**
366
- * Enhanced syntax highlighting for High Contrast Dark theme
367
- */
368
- const highContrastDarkHighlightStyle = HighlightStyle.define([
369
- // Keywords and control flow
370
- { tag: t.keyword, color: brightMagenta, fontWeight: 'bold' },
371
- { tag: t.controlKeyword, color: brightMagenta, fontWeight: 'bold' },
372
- { tag: t.moduleKeyword, color: brightMagenta, fontWeight: 'bold' },
373
-
374
- // Names and variables
375
- { tag: [t.name, t.deleted, t.character, t.macroName], color: base05 },
376
- { tag: [t.variableName], color: base05 },
377
- { tag: [t.propertyName], color: brightCyan, fontStyle: 'normal' },
378
-
379
- // Classes and types
380
- { tag: [t.typeName], color: brightYellow },
381
- { tag: [t.className], color: brightYellow, fontStyle: 'italic' },
382
- { tag: [t.namespace], color: brightOrange, fontStyle: 'italic' },
383
-
384
- // Operators and punctuation
385
- { tag: [t.operator, t.operatorKeyword], color: brightCyan },
386
- { tag: [t.bracket], color: brightYellow },
387
- { tag: [t.brace], color: brightCyan },
388
- { tag: [t.punctuation], color: base05 },
389
-
390
- // Functions and parameters
391
- { tag: [t.function(t.variableName), t.labelName], color: brightBlue },
392
- { tag: [t.definition(t.function(t.variableName))], color: brightBlue },
393
- { tag: [t.definition(t.variableName)], color: brightOrange },
394
-
395
- // Constants and literals
396
- { tag: t.number, color: brightOrange },
397
- { tag: t.changed, color: brightYellow },
398
- { tag: t.annotation, color: brightRed, fontStyle: 'italic' },
399
- { tag: t.modifier, color: brightPurple, fontStyle: 'italic' },
400
- { tag: t.self, color: brightRed },
401
- {
402
- tag: [t.color, t.constant(t.name), t.standard(t.name)],
403
- color: brightOrange,
404
- },
405
- { tag: [t.atom, t.bool, t.special(t.variableName)], color: brightOrange },
406
-
407
- // Strings and regex
408
- { tag: [t.processingInstruction, t.inserted], color: brightGreen },
409
- { tag: [t.special(t.string), t.regexp], color: brightMagenta },
410
- { tag: t.string, color: brightGreen },
411
-
412
- // Punctuation and structure
413
- { tag: t.definition(t.typeName), color: brightYellow, fontWeight: 'bold' },
414
- { tag: [t.definition(t.name), t.separator], color: brightCyan },
415
-
416
- // Comments and documentation
417
- { tag: t.meta, color: base03 },
418
- { tag: t.comment, fontStyle: 'italic', color: base03 },
419
- { tag: t.docComment, fontStyle: 'italic', color: base03 },
420
-
421
- // HTML/XML elements
422
- { tag: [t.tagName], color: brightMagenta },
423
- { tag: [t.attributeName], color: brightYellow },
424
-
425
- // Markdown and text formatting
426
- { tag: [t.heading], fontWeight: 'bold', color: brightMagenta },
427
- { tag: [t.strong], fontWeight: 'bold', color: brightOrange },
428
- { tag: [t.emphasis], fontStyle: 'italic', color: brightMagenta },
429
-
430
- // Links and URLs
431
- {
432
- tag: [t.link],
433
- color: visitedLinkColor,
434
- fontWeight: '500',
435
- textDecoration: 'underline',
436
- textUnderlinePosition: 'under',
437
- },
438
- {
439
- tag: [t.url],
440
- color: linkColor,
441
- textDecoration: 'underline',
442
- textUnderlineOffset: '2px',
443
- },
444
-
445
- // Special states
446
- {
447
- tag: [t.invalid],
448
- color: brightRed,
449
- textDecoration: 'underline wavy',
450
- borderBottom: `2px wavy ${brightRed}`,
451
- },
452
- { tag: [t.strikethrough], color: brightRed, textDecoration: 'line-through' },
453
-
454
- // Enhanced syntax highlighting
455
- { tag: t.constant(t.name), color: brightOrange },
456
- { tag: t.deleted, color: brightRed },
457
- { tag: t.squareBracket, color: brightYellow },
458
- { tag: t.angleBracket, color: brightCyan },
459
-
460
- // Additional specific styles
461
- { tag: t.monospace, color: brightBlue, fontStyle: 'italic' },
462
- { tag: [t.contentSeparator], color: brightPurple },
463
- { tag: t.quote, color: brightPurple },
464
- ]);
465
-
466
- /**
467
- * Combined High Contrast Dark theme extension
468
- */
469
- const highContrastDark: Extension = [
470
- highContrastDarkTheme,
471
- syntaxHighlighting(highContrastDarkHighlightStyle),
472
- ];
473
-
474
- /**
475
- * High Contrast Dark merge revert styles configuration
476
- */
477
- const highContrastDarkMergeStyles: IMergeRevertStyles = {
478
- backgroundColor: darkBackground,
479
- borderColor: brightCyan,
480
- buttonColor: brightCyan,
481
- buttonHoverColor: brightYellow,
482
- };
483
-
484
- export { highContrastDark, highContrastDarkMergeStyles, applyMergeRevertStyles };
package/src/utils.ts DELETED
@@ -1,126 +0,0 @@
1
- // Helper module for styling options
2
- export const generalContent = {
3
- fontSize: '14px',
4
- fontFamily: 'JetBrains Mono, Consolas, monospace',
5
- lineHeight: '1.6',
6
- };
7
-
8
- export const generalCursor = {
9
- borderLeftWidth: '2px',
10
- };
11
-
12
- export const generalDiff = {
13
- insertedTextDecoration: 'none',
14
- deletedTextDecoration: 'line-through',
15
- insertedLinePadding: '1px 3px',
16
- borderRadious: '3px',
17
- ins_del_linePadding: '1px 3px',
18
- };
19
-
20
- export const generalGutter = {
21
- border: 'none',
22
- paddingRight: '8px',
23
- fontSize: '0.9em',
24
- fontWeight: '500',
25
- lineHeight: '1.78', // Adjusted to compensate for 0.9em fontSize (1.6 / 0.9 ≈ 1.78)
26
- };
27
-
28
- export const generalPanel = {
29
- border: 'none',
30
- borderRadius: '4px',
31
- padding: '2px 10px',
32
- };
33
-
34
- export const generalLine = {
35
- borderRadius: '2px',
36
- };
37
-
38
- export const generalMatching = {
39
- borderRadius: '2px',
40
- };
41
-
42
- export const generalPlaceholder = {
43
- borderRadius: '4px',
44
- padding: '0 5px',
45
- margin: '0 2px',
46
- };
47
-
48
- export const generalScroller = {
49
- width: '12px',
50
- height: '12px',
51
- borderRadius: '6px',
52
- };
53
-
54
- export const generalSearchField = {
55
- borderRadius: '4px',
56
- padding: '2px 6px',
57
- };
58
-
59
- export const generalTooltip = {
60
- borderRadius: '4px',
61
- borderRadiusSelected: '3px',
62
- lineHeight: '1.3',
63
- padding: '4px 8px',
64
- paddingRight: '8px',
65
- };
66
-
67
- //---------------------------------------
68
-
69
- // Interface for merge revert styling options
70
- export interface IMergeRevertStyles {
71
- backgroundColor: string
72
- borderColor: string
73
- buttonColor: string
74
- buttonHoverColor: string
75
- }
76
-
77
- /**
78
- * Function to apply merge revert styles for a theme
79
- * @param styles Styles for the merge revert buttons
80
- * @param styles.backgroundColor Background color of the revert area
81
- * @param styles.borderColor Border color of the revert area
82
- * @param styles.buttonColor Color of the revert buttons
83
- * @param styles.buttonHoverColor Hover color of the revert buttons
84
- */
85
- export function applyMergeRevertStyles(styles: IMergeRevertStyles) {
86
- // Create a stylesheet
87
- const styleEl = document.createElement('style');
88
- styleEl.id = 'cm-merge-revert-styles';
89
-
90
- // Define CSS with the theme-specific values
91
- styleEl.textContent = `
92
- .cm-merge-revert {
93
- display: flex;
94
- flex-direction: column;
95
- align-items: center;
96
- justify-content: flex-start;
97
- padding: 4px;
98
- background-color: ${styles.backgroundColor};
99
- border-left: 1px solid ${styles.borderColor};
100
- border-right: 1px solid ${styles.borderColor};
101
- width: 32px;
102
- }
103
-
104
- .cm-merge-revert button {
105
- width: 100%;
106
- height: auto;
107
- background-color: transparent;
108
- border: none;
109
- color: ${styles.buttonColor};
110
- cursor: pointer;
111
- margin: 0 auto;
112
- font-size: 20px;
113
- }
114
-
115
- .cm-merge-revert button:hover {
116
- background-color: ${styles.buttonHoverColor};
117
- }
118
- `;
119
-
120
- // Remove any existing merge styles
121
- const existingStyle = document.getElementById('cm-merge-revert-styles');
122
- if (existingStyle) existingStyle.remove();
123
-
124
- // Add the new styles
125
- document.head.appendChild(styleEl);
126
- }