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