@fsegurai/codemirror-theme-palenight 6.1.4 → 6.2.0-beta

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 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/public/codemirror-themes.png">
3
3
  </p>
4
4
 
5
5
  <p align="center">
@@ -69,32 +69,32 @@ Read the [CodeMirror documentation](https://codemirror.net/6/examples/styling/)
69
69
 
70
70
  ### Available Themes
71
71
 
72
- - [All - Bundle](./packages/bundle)
73
- - [Abcdef](./packages/abcdef)
74
- - [Abyss](./packages/abyss)
75
- - [Android Studio](./packages/android-studio)
76
- - [Andromeda](./packages/andromeda)
77
- - [Basic Dark](./packages/basic-dark)
78
- - [Basic Light](./packages/basic-light)
79
- - [Forest](./packages/forest)
80
- - [GitHub Dark](./packages/github-dark)
81
- - [GitHub Light](./packages/github-light)
82
- - [Gruvbox Dark](./packages/gruvbox-dark)
83
- - [Gruvbox Light](./packages/gruvbox-light)
84
- - [Material Dark](./packages/material-dark)
85
- - [Material Light](./packages/material-light)
86
- - [Monokai](./packages/monokai)
87
- - [Nord](./packages/nord)
88
- - [Palenight](./packages/palenight)
89
- - [Solarized Dark](./packages/solarized-dark)
90
- - [Solarized Light](./packages/solarized-light)
91
- - [Tokyo Night Day](./packages/tokyo-night-day)
92
- - [Tokyo Night Storm](./packages/tokyo-night-storm)
93
- - [Volcano](./packages/volcano)
94
- - [VS Code Dark](./packages/vscode-dark)
95
- - [VS Code Light](./packages/vscode-light)
96
-
97
- For a full list, see the [<code>@fsegurai/codemirror-theme-bundle</code>](https://github.com/fsegurai/codemirror-themes/tree/main/packages/bundle) directory or the online demo.
72
+ | Theme | Package | Version |
73
+ |-------------------|----------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|
74
+ | All - Bundle | [@fsegurai/codemirror-theme-bundle](https://www.npmjs.com/package/@fsegurai/codemirror-theme-bundle) | ![npm](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-bundle) |
75
+ | Abcdef | [@fsegurai/codemirror-theme-abcdef](https://www.npmjs.com/package/@fsegurai/codemirror-theme-abcdef) | ![npm](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-abcdef) |
76
+ | Abyss | [@fsegurai/codemirror-theme-abyss](https://www.npmjs.com/package/@fsegurai/codemirror-theme-abyss) | ![npm](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-abyss) |
77
+ | Android Studio | [@fsegurai/codemirror-theme-android-studio](https://www.npmjs.com/package/@fsegurai/codemirror-theme-android-studio) | ![npm](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-android-studio) |
78
+ | Andromeda | [@fsegurai/codemirror-theme-andromeda](https://www.npmjs.com/package/@fsegurai/codemirror-theme-andromeda) | ![npm](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-andromeda) |
79
+ | Basic Light | [@fsegurai/codemirror-theme-basic-light](https://www.npmjs.com/package/@fsegurai/codemirror-theme-basic-light) | ![npm](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-basic-light) |
80
+ | Basic Dark | [@fsegurai/codemirror-theme-basic-dark](https://www.npmjs.com/package/@fsegurai/codemirror-theme-basic-dark) | ![npm](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-basic-dark) |
81
+ | Forest | [@fsegurai/codemirror-theme-forest](https://www.npmjs.com/package/@fsegurai/codemirror-theme-forest) | ![npm](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-forest) |
82
+ | GitHub Light | [@fsegurai/codemirror-theme-github-light](https://www.npmjs.com/package/@fsegurai/codemirror-theme-github-light) | ![npm](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-github-light) |
83
+ | GitHub Dark | [@fsegurai/codemirror-theme-github-dark](https://www.npmjs.com/package/@fsegurai/codemirror-theme-github-dark) | ![npm](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-github-dark) |
84
+ | Gruvbox Light | [@fsegurai/codemirror-theme-gruvbox-light](https://www.npmjs.com/package/@fsegurai/codemirror-theme-gruvbox-light) | ![npm](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-gruvbox-light) |
85
+ | Gruvbox Dark | [@fsegurai/codemirror-theme-gruvbox-dark](https://www.npmjs.com/package/@fsegurai/codemirror-theme-gruvbox-dark) | ![npm](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-gruvbox-dark) |
86
+ | 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) |
87
+ | 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) |
88
+ | 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) |
89
+ | 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) |
90
+ | 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) |
91
+ | Solarized Light | [@fsegurai/codemirror-theme-solarized-light](https://www.npmjs.com/package/@fsegurai/codemirror-theme-solarized-light) | ![npm](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-solarized-light) |
92
+ | Solarized Dark | [@fsegurai/codemirror-theme-solarized-dark](https://www.npmjs.com/package/@fsegurai/codemirror-theme-solarized-dark) | ![npm](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-solarized-dark) |
93
+ | Tokyo Night Storm | [@fsegurai/codemirror-theme-tokyo-night-storm](https://www.npmjs.com/package/@fsegurai/codemirror-theme-tokyo-night-storm) | ![npm](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-tokyo-night-storm) |
94
+ | Tokyo Night Day | [@fsegurai/codemirror-theme-tokyo-night-day](https://www.npmjs.com/package/@fsegurai/codemirror-theme-tokyo-night-day) | ![npm](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-tokyo-night-day) |
95
+ | Volcano | [@fsegurai/codemirror-theme-volcano](https://www.npmjs.com/package/@fsegurai/codemirror-theme-volcano) | ![npm](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-volcano) |
96
+ | VS Code Dark | [@fsegurai/codemirror-theme-vscode-dark](https://www.npmjs.com/package/@fsegurai/codemirror-theme-vscode-dark) | ![npm](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-vscode-dark) |
97
+ | VS Code Light | [@fsegurai/codemirror-theme-vscode-light](https://www.npmjs.com/package/@fsegurai/codemirror-theme-vscode-light) | ![npm](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-vscode-light) |
98
98
 
99
99
  ### Demo Application
100
100
 
package/dist/index.cjs CHANGED
@@ -3,88 +3,348 @@
3
3
  var view = require('@codemirror/view');
4
4
  var language = require('@codemirror/language');
5
5
  var highlight = require('@lezer/highlight');
6
+ var _utils = require('@utils');
6
7
 
7
- // Palenight theme color definitions
8
- const base00 = '#292D3E', // Background
9
- base01 = '#A6ACCD', // Foreground
10
- base02 = '#444267', // Darker selection match
11
- base03 = '#676E95', // Comments
12
- base04 = '#A6ACCD', // Cursor color
13
- base05 = '#C3E88D', // Green for strings and regex
14
- base06 = '#33374D', // Line highlight
15
- base07 = '#82AAFF', // Blue for keywords, type names, and operators
16
- base08 = '#F78C6C'; // Orange for numbers, headings, and constants
17
- const invalid = '#FF5370', // Red for invalid elements
18
- darkBackground = base00, highlightBackground = base06, background = base00, // Main background
19
- tooltipBackground = '#444267', selection = '#444267', cursor = base04; // Cursor color
20
- // The editor theme styles for Palenight
8
+ /**
9
+ * Enhanced Palenight theme color definitions
10
+ * ---------------------------------------
11
+ * Colors organized by function with visual color blocks
12
+ */
13
+ // Base colors
14
+ const base00 = '#292D3E'; // Background - deep indigo
15
+ const base01 = '#A6ACCD'; // Foreground - lavender blue
16
+ const base02 = '#444267'; // Selection background - muted indigo
17
+ const base03 = '#676E95'; // Comments, invisible - steel blue
18
+ const base04 = '#BFC7D5'; // Cursor - lighter lavender
19
+ // Accent colors
20
+ const base05 = '#C3E88D'; // Strings - light green
21
+ const base06 = '#82AAFF'; // Keywords, Functions - sky blue
22
+ const base07 = '#C792EA'; // Classes, Types - purple
23
+ const base08 = '#F78C6C'; // Numbers, Constants - orange
24
+ const base09 = '#FFCB6B'; // Classes, Attributes - yellow
25
+ const base0A = '#89DDFF'; // Punctuation, Operators - light blue
26
+ const base0B = '#FF5370'; // Tags, Errors - red
27
+ const base0C = '#BB80B3'; // Special elements - mauve
28
+ const base0D = '#80CBC4'; // Properties - seafoam
29
+ // UI specific colors
30
+ const invalid = '#FF5370'; // Error color - red
31
+ const darkBackground = '#202331'; // Darker background for panels and gutter
32
+ const highlightBackground = '#2e324817'; // Active line background
33
+ const background = base00; // Main editor background
34
+ const tooltipBackground = '#343A50'; // Tooltip background
35
+ const selection = base02; // Selection background
36
+ const selectionMatch = '#444267AA'; // Selection match with opacity
37
+ const cursor = base04; // Cursor color
38
+ const activeBracketBg = '#2E3248'; // Active bracket background
39
+ const activeBracketBorder = base06; // Active bracket border - sky blue
40
+ const diagnosticWarning = base09; // Warning color - yellow
41
+ const linkColor = base06; // Link color - sky blue
42
+ const visitedLinkColor = base07; // Visited link color - purple
43
+ /**
44
+ * Enhanced editor theme styles for Palenight
45
+ */
21
46
  const palenightTheme = view.EditorView.theme({
47
+ // Base editor styles
22
48
  '&': {
23
49
  color: base01,
24
50
  backgroundColor: background,
51
+ fontSize: _utils.generalContent.fontSize,
52
+ fontFamily: _utils.generalContent.fontFamily,
25
53
  },
54
+ // Content and cursor
26
55
  '.cm-content': {
27
56
  caretColor: cursor,
57
+ lineHeight: _utils.generalContent.lineHeight,
28
58
  },
29
59
  '.cm-cursor, .cm-dropCursor': {
30
60
  borderLeftColor: cursor,
61
+ borderLeftWidth: _utils.generalCursor.borderLeftWidth,
31
62
  },
63
+ '.cm-fat-cursor': {
64
+ backgroundColor: `${cursor}99`,
65
+ color: background,
66
+ },
67
+ // Selection
32
68
  '&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': {
33
69
  backgroundColor: selection,
34
70
  },
71
+ // Make sure selection appears above active line
72
+ '.cm-selectionLayer': {
73
+ zIndex: 100,
74
+ },
75
+ // Search functionality
76
+ '.cm-searchMatch': {
77
+ backgroundColor: '#444267CC',
78
+ outline: `1px solid ${base06}`,
79
+ color: base01,
80
+ borderRadius: _utils.generalSearchField.borderRadius,
81
+ '& span': {
82
+ color: base01,
83
+ },
84
+ },
85
+ '.cm-searchMatch.cm-searchMatch-selected': {
86
+ backgroundColor: base06,
87
+ color: background,
88
+ padding: _utils.generalSearchField.padding,
89
+ '& span': {
90
+ color: background,
91
+ },
92
+ },
93
+ '.cm-search.cm-panel.cm-textfield': {
94
+ color: base01,
95
+ borderRadius: _utils.generalSearchField.borderRadius,
96
+ padding: _utils.generalSearchField.padding,
97
+ },
98
+ // Panels
35
99
  '.cm-panels': {
36
100
  backgroundColor: darkBackground,
37
- color: base03,
101
+ color: base01,
102
+ borderRadius: '4px',
38
103
  },
39
- '.cm-activeLine': {
40
- backgroundColor: highlightBackground,
104
+ '.cm-panels.cm-panels-top': {
105
+ borderBottom: `1px solid ${base02}`,
41
106
  },
42
- '.cm-selectionMatch': {
43
- backgroundColor: base02,
107
+ '.cm-panels.cm-panels-bottom': {
108
+ borderTop: `1px solid ${base02}`,
44
109
  },
45
- '&.cm-focused .cm-matchingBracket': {
110
+ '.cm-panel button': {
111
+ backgroundColor: tooltipBackground,
112
+ color: base01,
113
+ border: _utils.generalPanel.border,
114
+ borderRadius: _utils.generalPanel.borderRadius,
115
+ padding: _utils.generalPanel.padding,
116
+ },
117
+ '.cm-panel button:hover': {
118
+ backgroundColor: '#3A4058',
119
+ },
120
+ // Line highlighting
121
+ '.cm-activeLine': {
46
122
  backgroundColor: highlightBackground,
123
+ borderRadius: _utils.generalLine.borderRadius,
124
+ zIndex: 1,
47
125
  },
126
+ // Gutters
48
127
  '.cm-gutters': {
49
128
  backgroundColor: darkBackground,
50
129
  color: base03,
51
- border: 'none',
130
+ border: _utils.generalGutter.border,
131
+ borderRight: '1px solid #3A405880',
132
+ paddingRight: _utils.generalGutter.paddingRight,
133
+ },
134
+ '.cm-activeLineGutter': {
135
+ backgroundColor: '#2A2D40',
136
+ color: base01,
137
+ fontWeight: _utils.generalGutter.fontWeight,
138
+ },
139
+ '.cm-lineNumbers': {
140
+ fontSize: _utils.generalGutter.fontSize,
141
+ },
142
+ '.cm-foldGutter': {
143
+ fontSize: _utils.generalGutter.fontSize,
144
+ },
145
+ '.cm-foldGutter .cm-gutterElement': {
146
+ color: base03,
147
+ cursor: 'pointer',
148
+ },
149
+ '.cm-foldGutter .cm-gutterElement:hover': {
150
+ color: base01,
52
151
  },
152
+ // Tooltips and autocomplete
53
153
  '.cm-tooltip': {
54
154
  backgroundColor: tooltipBackground,
155
+ border: '1px solid #3A4058',
156
+ borderRadius: _utils.generalTooltip.borderRadius,
157
+ padding: _utils.generalTooltip.padding,
158
+ boxShadow: '0 2px 8px rgba(0, 0, 0, 0.4)',
159
+ },
160
+ '.cm-tooltip-autocomplete': {
161
+ '& > ul': {
162
+ backgroundColor: tooltipBackground,
163
+ border: 'none',
164
+ },
165
+ '& > ul > li': {
166
+ padding: _utils.generalTooltip.padding,
167
+ lineHeight: _utils.generalTooltip.lineHeight,
168
+ },
169
+ '& > ul > li[aria-selected]': {
170
+ backgroundColor: selection,
171
+ color: base04,
172
+ borderRadius: _utils.generalTooltip.borderRadiusSelected,
173
+ },
174
+ '& > ul > li > span.cm-completionIcon': {
175
+ color: base03,
176
+ paddingRight: _utils.generalTooltip.paddingRight,
177
+ },
178
+ '& > ul > li > span.cm-completionDetail': {
179
+ color: base03,
180
+ fontStyle: 'italic',
181
+ },
182
+ },
183
+ '.cm-tooltip .cm-tooltip-arrow:before': {
184
+ borderTopColor: 'transparent',
185
+ borderBottomColor: 'transparent',
186
+ },
187
+ '.cm-tooltip .cm-tooltip-arrow:after': {
188
+ borderTopColor: tooltipBackground,
189
+ borderBottomColor: tooltipBackground,
190
+ },
191
+ // Diagnostics styling
192
+ '.cm-diagnostic': {
193
+ '&-error': {
194
+ borderLeft: `3px solid ${invalid}`,
195
+ },
196
+ '&-warning': {
197
+ borderLeft: `3px solid ${diagnosticWarning}`,
198
+ },
199
+ '&-info': {
200
+ borderLeft: `3px solid ${linkColor}`,
201
+ },
202
+ },
203
+ '.cm-lintPoint-error': {
204
+ borderBottom: `2px wavy ${invalid}`,
205
+ },
206
+ '.cm-lintPoint-warning': {
207
+ borderBottom: `2px wavy ${diagnosticWarning}`,
208
+ },
209
+ // Matching brackets
210
+ '.cm-matchingBracket': {
211
+ backgroundColor: activeBracketBg,
212
+ outline: `1px solid ${activeBracketBorder}`,
213
+ borderRadius: _utils.generalMatching.borderRadius,
214
+ },
215
+ '.cm-nonmatchingBracket': {
216
+ backgroundColor: `${invalid}40`,
217
+ outline: `1px solid ${invalid}`,
218
+ borderRadius: _utils.generalMatching.borderRadius,
219
+ },
220
+ // Selection matches
221
+ '.cm-selectionMatch': {
222
+ backgroundColor: selectionMatch,
223
+ outline: `1px solid ${base03}50`,
224
+ borderRadius: _utils.generalMatching.borderRadius,
225
+ },
226
+ // Fold placeholder
227
+ '.cm-foldPlaceholder': {
228
+ backgroundColor: tooltipBackground,
229
+ color: base03,
230
+ border: `1px dotted ${base03}70`,
231
+ borderRadius: _utils.generalPlaceholder.borderRadius,
232
+ padding: _utils.generalPlaceholder.padding,
233
+ margin: _utils.generalPlaceholder.margin,
234
+ },
235
+ // Focus outline
236
+ '&.cm-focused': {
237
+ outline: 'none',
238
+ boxShadow: `0 0 0 2px ${background}, 0 0 0 3px ${base06}40`,
239
+ },
240
+ // Scrollbars
241
+ '& .cm-scroller::-webkit-scrollbar': {
242
+ width: _utils.generalScroller.width,
243
+ height: _utils.generalScroller.height,
244
+ },
245
+ '& .cm-scroller::-webkit-scrollbar-track': {
246
+ background: darkBackground,
247
+ },
248
+ '& .cm-scroller::-webkit-scrollbar-thumb': {
249
+ backgroundColor: base02,
250
+ borderRadius: _utils.generalScroller.borderRadius,
251
+ border: `3px solid ${darkBackground}`,
252
+ },
253
+ '& .cm-scroller::-webkit-scrollbar-thumb:hover': {
254
+ backgroundColor: '#515580',
255
+ },
256
+ // Ghost text
257
+ '.cm-ghostText': {
258
+ opacity: '0.5',
259
+ color: base03,
55
260
  },
56
261
  }, { dark: true });
57
- // The highlighting style for Palenight
262
+ /**
263
+ * Enhanced syntax highlighting for Palenight theme
264
+ */
58
265
  const palenightHighlightStyle = language.HighlightStyle.define([
59
- { tag: highlight.tags.keyword, color: base07 },
266
+ // Keywords and control flow
267
+ { tag: highlight.tags.keyword, color: base06, fontWeight: 'bold' },
268
+ { tag: highlight.tags.controlKeyword, color: base06, fontWeight: 'bold' },
269
+ { tag: highlight.tags.moduleKeyword, color: base06, fontWeight: 'bold' },
270
+ // Names and variables
60
271
  { tag: [highlight.tags.name, highlight.tags.deleted, highlight.tags.character, highlight.tags.macroName], color: base01 },
61
- { tag: [highlight.tags.propertyName], color: base01 },
272
+ { tag: [highlight.tags.variableName], color: base01 },
273
+ { tag: [highlight.tags.propertyName], color: base0D, fontStyle: 'normal' },
274
+ // Classes and types
275
+ { tag: [highlight.tags.typeName], color: base07 },
276
+ { tag: [highlight.tags.className], color: base09, fontStyle: 'italic' },
277
+ { tag: [highlight.tags.namespace], color: base09, fontStyle: 'italic' },
278
+ // Operators and punctuation
279
+ { tag: [highlight.tags.operator, highlight.tags.operatorKeyword], color: base0A },
280
+ { tag: [highlight.tags.bracket], color: base0A },
281
+ { tag: [highlight.tags.brace], color: base0A },
282
+ { tag: [highlight.tags.punctuation], color: base0A },
283
+ // Functions and parameters
284
+ { tag: [highlight.tags.function(highlight.tags.variableName), highlight.tags.labelName], color: base06 },
285
+ { tag: [highlight.tags.definition(highlight.tags.function(highlight.tags.variableName))], color: base06 },
286
+ { tag: [highlight.tags.definition(highlight.tags.variableName)], color: base08 },
287
+ // Constants and literals
288
+ { tag: highlight.tags.number, color: base08 },
289
+ { tag: highlight.tags.changed, color: base08 },
290
+ { tag: highlight.tags.annotation, color: invalid, fontStyle: 'italic' },
291
+ { tag: highlight.tags.modifier, color: base0C, fontStyle: 'italic' },
292
+ { tag: highlight.tags.self, color: base07 },
293
+ { tag: [highlight.tags.color, highlight.tags.constant(highlight.tags.name), highlight.tags.standard(highlight.tags.name)], color: base08 },
294
+ { tag: [highlight.tags.atom, highlight.tags.bool, highlight.tags.special(highlight.tags.variableName)], color: base0C },
295
+ // Strings and regex
296
+ { tag: [highlight.tags.processingInstruction, highlight.tags.inserted], color: base05 },
297
+ { tag: [highlight.tags.special(highlight.tags.string), highlight.tags.regexp], color: base05 },
298
+ { tag: highlight.tags.string, color: base05 },
299
+ // Punctuation and structure
300
+ { tag: highlight.tags.definition(highlight.tags.typeName), color: base07, fontWeight: 'bold' },
301
+ { tag: [highlight.tags.definition(highlight.tags.name), highlight.tags.separator], color: base0A },
302
+ // Comments and documentation
303
+ { tag: highlight.tags.meta, color: base03 },
304
+ { tag: highlight.tags.comment, fontStyle: 'italic', color: base03 },
305
+ { tag: highlight.tags.docComment, fontStyle: 'italic', color: base03 },
306
+ // HTML/XML elements
307
+ { tag: [highlight.tags.tagName], color: base0B },
308
+ { tag: [highlight.tags.attributeName], color: base09 },
309
+ // Markdown and text formatting
310
+ { tag: [highlight.tags.heading], fontWeight: 'bold', color: base09 },
311
+ { tag: [highlight.tags.strong], fontWeight: 'bold', color: base09 },
312
+ { tag: [highlight.tags.emphasis], fontStyle: 'italic', color: base05 },
313
+ // Links and URLs
62
314
  {
63
- tag: [highlight.tags.processingInstruction, highlight.tags.string, highlight.tags.inserted, highlight.tags.special(highlight.tags.string)],
64
- color: base05,
315
+ tag: [highlight.tags.link],
316
+ color: visitedLinkColor,
317
+ fontWeight: '500',
318
+ textDecoration: 'underline',
319
+ textUnderlinePosition: 'under',
65
320
  },
66
- { tag: [highlight.tags.function(highlight.tags.variableName), highlight.tags.labelName], color: base01 },
67
- { tag: [highlight.tags.color, highlight.tags.constant(highlight.tags.name), highlight.tags.standard(highlight.tags.name)], color: base01 },
68
- { tag: [highlight.tags.definition(highlight.tags.name), highlight.tags.separator], color: base01 },
69
- { tag: [highlight.tags.className], color: base01 },
70
321
  {
71
- tag: [highlight.tags.number, highlight.tags.changed, highlight.tags.annotation, highlight.tags.modifier, highlight.tags.self, highlight.tags.namespace],
72
- color: base08,
322
+ tag: [highlight.tags.url],
323
+ color: linkColor,
324
+ textDecoration: 'underline',
325
+ textUnderlineOffset: '2px',
73
326
  },
74
- { tag: [highlight.tags.typeName], color: base07 },
75
- { tag: [highlight.tags.operator, highlight.tags.operatorKeyword], color: base07 },
76
- { tag: [highlight.tags.url, highlight.tags.escape, highlight.tags.regexp, highlight.tags.link], color: base05 },
77
- { tag: [highlight.tags.meta, highlight.tags.comment], color: base03 },
78
- { tag: highlight.tags.tagName, color: base07 },
79
- { tag: highlight.tags.strong, fontWeight: 'bold' },
80
- { tag: highlight.tags.emphasis, fontStyle: 'italic' },
81
- { tag: highlight.tags.link, textDecoration: 'underline' },
82
- { tag: highlight.tags.heading, fontWeight: 'bold', color: base08 },
83
- { tag: [highlight.tags.atom, highlight.tags.bool, highlight.tags.special(highlight.tags.variableName)], color: base01 },
84
- { tag: highlight.tags.invalid, color: invalid },
85
- { tag: highlight.tags.strikethrough, textDecoration: 'line-through' },
327
+ // Special states
328
+ {
329
+ tag: [highlight.tags.invalid],
330
+ color: base01,
331
+ textDecoration: 'underline wavy',
332
+ borderBottom: `1px wavy ${invalid}`,
333
+ },
334
+ { tag: [highlight.tags.strikethrough], color: invalid, textDecoration: 'line-through' },
335
+ // Enhanced syntax highlighting
336
+ { tag: highlight.tags.constant(highlight.tags.name), color: base08 },
337
+ { tag: highlight.tags.deleted, color: invalid },
338
+ { tag: highlight.tags.squareBracket, color: base0A },
339
+ { tag: highlight.tags.angleBracket, color: base0A },
340
+ // Additional specific styles
341
+ { tag: highlight.tags.monospace, color: base01 },
342
+ { tag: [highlight.tags.contentSeparator], color: base09 },
343
+ { tag: highlight.tags.quote, color: base03 },
86
344
  ]);
87
- // Extension to enable the Palenight theme (both editor theme and highlight style)
345
+ /**
346
+ * Combined Palenight theme extension
347
+ */
88
348
  const palenight = [
89
349
  palenightTheme,
90
350
  language.syntaxHighlighting(palenightHighlightStyle),
package/dist/index.d.cts CHANGED
@@ -1,8 +1,17 @@
1
1
  import { Extension } from '@codemirror/state';
2
2
  import { HighlightStyle } from '@codemirror/language';
3
3
 
4
+ /**
5
+ * Enhanced editor theme styles for Palenight
6
+ */
4
7
  declare const palenightTheme: Extension;
8
+ /**
9
+ * Enhanced syntax highlighting for Palenight theme
10
+ */
5
11
  declare const palenightHighlightStyle: HighlightStyle;
12
+ /**
13
+ * Combined Palenight theme extension
14
+ */
6
15
  declare const palenight: Extension;
7
16
 
8
17
  export { palenight, palenightHighlightStyle, palenightTheme };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,17 @@
1
1
  import { Extension } from '@codemirror/state';
2
2
  import { HighlightStyle } from '@codemirror/language';
3
3
 
4
+ /**
5
+ * Enhanced editor theme styles for Palenight
6
+ */
4
7
  declare const palenightTheme: Extension;
8
+ /**
9
+ * Enhanced syntax highlighting for Palenight theme
10
+ */
5
11
  declare const palenightHighlightStyle: HighlightStyle;
12
+ /**
13
+ * Combined Palenight theme extension
14
+ */
6
15
  declare const palenight: Extension;
7
16
 
8
17
  export { palenight, palenightHighlightStyle, palenightTheme };
package/dist/index.js CHANGED
@@ -1,88 +1,348 @@
1
1
  import { EditorView } from '@codemirror/view';
2
2
  import { HighlightStyle, syntaxHighlighting } from '@codemirror/language';
3
3
  import { tags } from '@lezer/highlight';
4
+ import { generalScroller, generalPlaceholder, generalMatching, generalTooltip, generalGutter, generalLine, generalPanel, generalSearchField, generalCursor, generalContent } from '@utils';
4
5
 
5
- // Palenight theme color definitions
6
- const base00 = '#292D3E', // Background
7
- base01 = '#A6ACCD', // Foreground
8
- base02 = '#444267', // Darker selection match
9
- base03 = '#676E95', // Comments
10
- base04 = '#A6ACCD', // Cursor color
11
- base05 = '#C3E88D', // Green for strings and regex
12
- base06 = '#33374D', // Line highlight
13
- base07 = '#82AAFF', // Blue for keywords, type names, and operators
14
- base08 = '#F78C6C'; // Orange for numbers, headings, and constants
15
- const invalid = '#FF5370', // Red for invalid elements
16
- darkBackground = base00, highlightBackground = base06, background = base00, // Main background
17
- tooltipBackground = '#444267', selection = '#444267', cursor = base04; // Cursor color
18
- // The editor theme styles for Palenight
6
+ /**
7
+ * Enhanced Palenight theme color definitions
8
+ * ---------------------------------------
9
+ * Colors organized by function with visual color blocks
10
+ */
11
+ // Base colors
12
+ const base00 = '#292D3E'; // Background - deep indigo
13
+ const base01 = '#A6ACCD'; // Foreground - lavender blue
14
+ const base02 = '#444267'; // Selection background - muted indigo
15
+ const base03 = '#676E95'; // Comments, invisible - steel blue
16
+ const base04 = '#BFC7D5'; // Cursor - lighter lavender
17
+ // Accent colors
18
+ const base05 = '#C3E88D'; // Strings - light green
19
+ const base06 = '#82AAFF'; // Keywords, Functions - sky blue
20
+ const base07 = '#C792EA'; // Classes, Types - purple
21
+ const base08 = '#F78C6C'; // Numbers, Constants - orange
22
+ const base09 = '#FFCB6B'; // Classes, Attributes - yellow
23
+ const base0A = '#89DDFF'; // Punctuation, Operators - light blue
24
+ const base0B = '#FF5370'; // Tags, Errors - red
25
+ const base0C = '#BB80B3'; // Special elements - mauve
26
+ const base0D = '#80CBC4'; // Properties - seafoam
27
+ // UI specific colors
28
+ const invalid = '#FF5370'; // Error color - red
29
+ const darkBackground = '#202331'; // Darker background for panels and gutter
30
+ const highlightBackground = '#2e324817'; // Active line background
31
+ const background = base00; // Main editor background
32
+ const tooltipBackground = '#343A50'; // Tooltip background
33
+ const selection = base02; // Selection background
34
+ const selectionMatch = '#444267AA'; // Selection match with opacity
35
+ const cursor = base04; // Cursor color
36
+ const activeBracketBg = '#2E3248'; // Active bracket background
37
+ const activeBracketBorder = base06; // Active bracket border - sky blue
38
+ const diagnosticWarning = base09; // Warning color - yellow
39
+ const linkColor = base06; // Link color - sky blue
40
+ const visitedLinkColor = base07; // Visited link color - purple
41
+ /**
42
+ * Enhanced editor theme styles for Palenight
43
+ */
19
44
  const palenightTheme = /*@__PURE__*/EditorView.theme({
45
+ // Base editor styles
20
46
  '&': {
21
47
  color: base01,
22
48
  backgroundColor: background,
49
+ fontSize: generalContent.fontSize,
50
+ fontFamily: generalContent.fontFamily,
23
51
  },
52
+ // Content and cursor
24
53
  '.cm-content': {
25
54
  caretColor: cursor,
55
+ lineHeight: generalContent.lineHeight,
26
56
  },
27
57
  '.cm-cursor, .cm-dropCursor': {
28
58
  borderLeftColor: cursor,
59
+ borderLeftWidth: generalCursor.borderLeftWidth,
29
60
  },
61
+ '.cm-fat-cursor': {
62
+ backgroundColor: `${cursor}99`,
63
+ color: background,
64
+ },
65
+ // Selection
30
66
  '&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': {
31
67
  backgroundColor: selection,
32
68
  },
69
+ // Make sure selection appears above active line
70
+ '.cm-selectionLayer': {
71
+ zIndex: 100,
72
+ },
73
+ // Search functionality
74
+ '.cm-searchMatch': {
75
+ backgroundColor: '#444267CC',
76
+ outline: `1px solid ${base06}`,
77
+ color: base01,
78
+ borderRadius: generalSearchField.borderRadius,
79
+ '& span': {
80
+ color: base01,
81
+ },
82
+ },
83
+ '.cm-searchMatch.cm-searchMatch-selected': {
84
+ backgroundColor: base06,
85
+ color: background,
86
+ padding: generalSearchField.padding,
87
+ '& span': {
88
+ color: background,
89
+ },
90
+ },
91
+ '.cm-search.cm-panel.cm-textfield': {
92
+ color: base01,
93
+ borderRadius: generalSearchField.borderRadius,
94
+ padding: generalSearchField.padding,
95
+ },
96
+ // Panels
33
97
  '.cm-panels': {
34
98
  backgroundColor: darkBackground,
35
- color: base03,
99
+ color: base01,
100
+ borderRadius: '4px',
36
101
  },
37
- '.cm-activeLine': {
38
- backgroundColor: highlightBackground,
102
+ '.cm-panels.cm-panels-top': {
103
+ borderBottom: `1px solid ${base02}`,
39
104
  },
40
- '.cm-selectionMatch': {
41
- backgroundColor: base02,
105
+ '.cm-panels.cm-panels-bottom': {
106
+ borderTop: `1px solid ${base02}`,
42
107
  },
43
- '&.cm-focused .cm-matchingBracket': {
108
+ '.cm-panel button': {
109
+ backgroundColor: tooltipBackground,
110
+ color: base01,
111
+ border: generalPanel.border,
112
+ borderRadius: generalPanel.borderRadius,
113
+ padding: generalPanel.padding,
114
+ },
115
+ '.cm-panel button:hover': {
116
+ backgroundColor: '#3A4058',
117
+ },
118
+ // Line highlighting
119
+ '.cm-activeLine': {
44
120
  backgroundColor: highlightBackground,
121
+ borderRadius: generalLine.borderRadius,
122
+ zIndex: 1,
45
123
  },
124
+ // Gutters
46
125
  '.cm-gutters': {
47
126
  backgroundColor: darkBackground,
48
127
  color: base03,
49
- border: 'none',
128
+ border: generalGutter.border,
129
+ borderRight: '1px solid #3A405880',
130
+ paddingRight: generalGutter.paddingRight,
131
+ },
132
+ '.cm-activeLineGutter': {
133
+ backgroundColor: '#2A2D40',
134
+ color: base01,
135
+ fontWeight: generalGutter.fontWeight,
136
+ },
137
+ '.cm-lineNumbers': {
138
+ fontSize: generalGutter.fontSize,
139
+ },
140
+ '.cm-foldGutter': {
141
+ fontSize: generalGutter.fontSize,
142
+ },
143
+ '.cm-foldGutter .cm-gutterElement': {
144
+ color: base03,
145
+ cursor: 'pointer',
146
+ },
147
+ '.cm-foldGutter .cm-gutterElement:hover': {
148
+ color: base01,
50
149
  },
150
+ // Tooltips and autocomplete
51
151
  '.cm-tooltip': {
52
152
  backgroundColor: tooltipBackground,
153
+ border: '1px solid #3A4058',
154
+ borderRadius: generalTooltip.borderRadius,
155
+ padding: generalTooltip.padding,
156
+ boxShadow: '0 2px 8px rgba(0, 0, 0, 0.4)',
157
+ },
158
+ '.cm-tooltip-autocomplete': {
159
+ '& > ul': {
160
+ backgroundColor: tooltipBackground,
161
+ border: 'none',
162
+ },
163
+ '& > ul > li': {
164
+ padding: generalTooltip.padding,
165
+ lineHeight: generalTooltip.lineHeight,
166
+ },
167
+ '& > ul > li[aria-selected]': {
168
+ backgroundColor: selection,
169
+ color: base04,
170
+ borderRadius: generalTooltip.borderRadiusSelected,
171
+ },
172
+ '& > ul > li > span.cm-completionIcon': {
173
+ color: base03,
174
+ paddingRight: generalTooltip.paddingRight,
175
+ },
176
+ '& > ul > li > span.cm-completionDetail': {
177
+ color: base03,
178
+ fontStyle: 'italic',
179
+ },
180
+ },
181
+ '.cm-tooltip .cm-tooltip-arrow:before': {
182
+ borderTopColor: 'transparent',
183
+ borderBottomColor: 'transparent',
184
+ },
185
+ '.cm-tooltip .cm-tooltip-arrow:after': {
186
+ borderTopColor: tooltipBackground,
187
+ borderBottomColor: tooltipBackground,
188
+ },
189
+ // Diagnostics styling
190
+ '.cm-diagnostic': {
191
+ '&-error': {
192
+ borderLeft: `3px solid ${invalid}`,
193
+ },
194
+ '&-warning': {
195
+ borderLeft: `3px solid ${diagnosticWarning}`,
196
+ },
197
+ '&-info': {
198
+ borderLeft: `3px solid ${linkColor}`,
199
+ },
200
+ },
201
+ '.cm-lintPoint-error': {
202
+ borderBottom: `2px wavy ${invalid}`,
203
+ },
204
+ '.cm-lintPoint-warning': {
205
+ borderBottom: `2px wavy ${diagnosticWarning}`,
206
+ },
207
+ // Matching brackets
208
+ '.cm-matchingBracket': {
209
+ backgroundColor: activeBracketBg,
210
+ outline: `1px solid ${activeBracketBorder}`,
211
+ borderRadius: generalMatching.borderRadius,
212
+ },
213
+ '.cm-nonmatchingBracket': {
214
+ backgroundColor: `${invalid}40`,
215
+ outline: `1px solid ${invalid}`,
216
+ borderRadius: generalMatching.borderRadius,
217
+ },
218
+ // Selection matches
219
+ '.cm-selectionMatch': {
220
+ backgroundColor: selectionMatch,
221
+ outline: `1px solid ${base03}50`,
222
+ borderRadius: generalMatching.borderRadius,
223
+ },
224
+ // Fold placeholder
225
+ '.cm-foldPlaceholder': {
226
+ backgroundColor: tooltipBackground,
227
+ color: base03,
228
+ border: `1px dotted ${base03}70`,
229
+ borderRadius: generalPlaceholder.borderRadius,
230
+ padding: generalPlaceholder.padding,
231
+ margin: generalPlaceholder.margin,
232
+ },
233
+ // Focus outline
234
+ '&.cm-focused': {
235
+ outline: 'none',
236
+ boxShadow: `0 0 0 2px ${background}, 0 0 0 3px ${base06}40`,
237
+ },
238
+ // Scrollbars
239
+ '& .cm-scroller::-webkit-scrollbar': {
240
+ width: generalScroller.width,
241
+ height: generalScroller.height,
242
+ },
243
+ '& .cm-scroller::-webkit-scrollbar-track': {
244
+ background: darkBackground,
245
+ },
246
+ '& .cm-scroller::-webkit-scrollbar-thumb': {
247
+ backgroundColor: base02,
248
+ borderRadius: generalScroller.borderRadius,
249
+ border: `3px solid ${darkBackground}`,
250
+ },
251
+ '& .cm-scroller::-webkit-scrollbar-thumb:hover': {
252
+ backgroundColor: '#515580',
253
+ },
254
+ // Ghost text
255
+ '.cm-ghostText': {
256
+ opacity: '0.5',
257
+ color: base03,
53
258
  },
54
259
  }, { dark: true });
55
- // The highlighting style for Palenight
260
+ /**
261
+ * Enhanced syntax highlighting for Palenight theme
262
+ */
56
263
  const palenightHighlightStyle = /*@__PURE__*/HighlightStyle.define([
57
- { tag: tags.keyword, color: base07 },
264
+ // Keywords and control flow
265
+ { tag: tags.keyword, color: base06, fontWeight: 'bold' },
266
+ { tag: tags.controlKeyword, color: base06, fontWeight: 'bold' },
267
+ { tag: tags.moduleKeyword, color: base06, fontWeight: 'bold' },
268
+ // Names and variables
58
269
  { tag: [tags.name, tags.deleted, tags.character, tags.macroName], color: base01 },
59
- { tag: [tags.propertyName], color: base01 },
270
+ { tag: [tags.variableName], color: base01 },
271
+ { tag: [tags.propertyName], color: base0D, fontStyle: 'normal' },
272
+ // Classes and types
273
+ { tag: [tags.typeName], color: base07 },
274
+ { tag: [tags.className], color: base09, fontStyle: 'italic' },
275
+ { tag: [tags.namespace], color: base09, fontStyle: 'italic' },
276
+ // Operators and punctuation
277
+ { tag: [tags.operator, tags.operatorKeyword], color: base0A },
278
+ { tag: [tags.bracket], color: base0A },
279
+ { tag: [tags.brace], color: base0A },
280
+ { tag: [tags.punctuation], color: base0A },
281
+ // Functions and parameters
282
+ { tag: [/*@__PURE__*/tags.function(tags.variableName), tags.labelName], color: base06 },
283
+ { tag: [/*@__PURE__*/tags.definition(/*@__PURE__*/tags.function(tags.variableName))], color: base06 },
284
+ { tag: [/*@__PURE__*/tags.definition(tags.variableName)], color: base08 },
285
+ // Constants and literals
286
+ { tag: tags.number, color: base08 },
287
+ { tag: tags.changed, color: base08 },
288
+ { tag: tags.annotation, color: invalid, fontStyle: 'italic' },
289
+ { tag: tags.modifier, color: base0C, fontStyle: 'italic' },
290
+ { tag: tags.self, color: base07 },
291
+ { tag: [tags.color, /*@__PURE__*/tags.constant(tags.name), /*@__PURE__*/tags.standard(tags.name)], color: base08 },
292
+ { tag: [tags.atom, tags.bool, /*@__PURE__*/tags.special(tags.variableName)], color: base0C },
293
+ // Strings and regex
294
+ { tag: [tags.processingInstruction, tags.inserted], color: base05 },
295
+ { tag: [/*@__PURE__*/tags.special(tags.string), tags.regexp], color: base05 },
296
+ { tag: tags.string, color: base05 },
297
+ // Punctuation and structure
298
+ { tag: /*@__PURE__*/tags.definition(tags.typeName), color: base07, fontWeight: 'bold' },
299
+ { tag: [/*@__PURE__*/tags.definition(tags.name), tags.separator], color: base0A },
300
+ // Comments and documentation
301
+ { tag: tags.meta, color: base03 },
302
+ { tag: tags.comment, fontStyle: 'italic', color: base03 },
303
+ { tag: tags.docComment, fontStyle: 'italic', color: base03 },
304
+ // HTML/XML elements
305
+ { tag: [tags.tagName], color: base0B },
306
+ { tag: [tags.attributeName], color: base09 },
307
+ // Markdown and text formatting
308
+ { tag: [tags.heading], fontWeight: 'bold', color: base09 },
309
+ { tag: [tags.strong], fontWeight: 'bold', color: base09 },
310
+ { tag: [tags.emphasis], fontStyle: 'italic', color: base05 },
311
+ // Links and URLs
60
312
  {
61
- tag: [tags.processingInstruction, tags.string, tags.inserted, /*@__PURE__*/tags.special(tags.string)],
62
- color: base05,
313
+ tag: [tags.link],
314
+ color: visitedLinkColor,
315
+ fontWeight: '500',
316
+ textDecoration: 'underline',
317
+ textUnderlinePosition: 'under',
63
318
  },
64
- { tag: [/*@__PURE__*/tags.function(tags.variableName), tags.labelName], color: base01 },
65
- { tag: [tags.color, /*@__PURE__*/tags.constant(tags.name), /*@__PURE__*/tags.standard(tags.name)], color: base01 },
66
- { tag: [/*@__PURE__*/tags.definition(tags.name), tags.separator], color: base01 },
67
- { tag: [tags.className], color: base01 },
68
319
  {
69
- tag: [tags.number, tags.changed, tags.annotation, tags.modifier, tags.self, tags.namespace],
70
- color: base08,
320
+ tag: [tags.url],
321
+ color: linkColor,
322
+ textDecoration: 'underline',
323
+ textUnderlineOffset: '2px',
71
324
  },
72
- { tag: [tags.typeName], color: base07 },
73
- { tag: [tags.operator, tags.operatorKeyword], color: base07 },
74
- { tag: [tags.url, tags.escape, tags.regexp, tags.link], color: base05 },
75
- { tag: [tags.meta, tags.comment], color: base03 },
76
- { tag: tags.tagName, color: base07 },
77
- { tag: tags.strong, fontWeight: 'bold' },
78
- { tag: tags.emphasis, fontStyle: 'italic' },
79
- { tag: tags.link, textDecoration: 'underline' },
80
- { tag: tags.heading, fontWeight: 'bold', color: base08 },
81
- { tag: [tags.atom, tags.bool, /*@__PURE__*/tags.special(tags.variableName)], color: base01 },
82
- { tag: tags.invalid, color: invalid },
83
- { tag: tags.strikethrough, textDecoration: 'line-through' },
325
+ // Special states
326
+ {
327
+ tag: [tags.invalid],
328
+ color: base01,
329
+ textDecoration: 'underline wavy',
330
+ borderBottom: `1px wavy ${invalid}`,
331
+ },
332
+ { tag: [tags.strikethrough], color: invalid, textDecoration: 'line-through' },
333
+ // Enhanced syntax highlighting
334
+ { tag: /*@__PURE__*/tags.constant(tags.name), color: base08 },
335
+ { tag: tags.deleted, color: invalid },
336
+ { tag: tags.squareBracket, color: base0A },
337
+ { tag: tags.angleBracket, color: base0A },
338
+ // Additional specific styles
339
+ { tag: tags.monospace, color: base01 },
340
+ { tag: [tags.contentSeparator], color: base09 },
341
+ { tag: tags.quote, color: base03 },
84
342
  ]);
85
- // Extension to enable the Palenight theme (both editor theme and highlight style)
343
+ /**
344
+ * Combined Palenight theme extension
345
+ */
86
346
  const palenight = [
87
347
  palenightTheme,
88
348
  /*@__PURE__*/syntaxHighlighting(palenightHighlightStyle),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fsegurai/codemirror-theme-palenight",
3
3
  "description": "Palenight theme for the CodeMirror code editor",
4
- "version": "6.1.4",
4
+ "version": "6.2.0-beta",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
7
7
  "exports": {