@@ -5,13 +5,88 @@ import { EditorState, Prec } from "@codemirror/state";
55import { EditorView , keymap , placeholder } from "@codemirror/view" ;
66import { defaultKeymap , historyKeymap , indentMore , indentLess , undo , redo } from "@codemirror/commands" ;
77import { history } from "@codemirror/commands" ;
8- import { oneDark } from "@codemirror/theme-one-dark" ;
98import { html } from "@codemirror/lang-html" ;
109import { css } from "@codemirror/lang-css" ;
1110import { autocompletion } from "@codemirror/autocomplete" ;
1211import { abbreviationTracker , expandAbbreviation } from "@emmetio/codemirror6-plugin" ;
12+ import { HighlightStyle , syntaxHighlighting } from "@codemirror/language" ;
13+ import { tags } from "@lezer/highlight" ;
1314
14- // Custom overrides for One Dark theme
15+ // Custom theme with purple accent colors (matching app completed state)
16+ const crispyTheme = EditorView . theme (
17+ {
18+ "&" : {
19+ backgroundColor : "#262630" ,
20+ color : "#c8c8d0"
21+ } ,
22+ ".cm-content" : {
23+ caretColor : "#9b6dd4"
24+ } ,
25+ ".cm-cursor, .cm-dropCursor" : {
26+ borderLeftColor : "#9b6dd4"
27+ } ,
28+ "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection" : {
29+ backgroundColor : "#3e3e4a"
30+ } ,
31+ ".cm-panels" : {
32+ backgroundColor : "#262630" ,
33+ color : "#c8c8d0"
34+ } ,
35+ ".cm-searchMatch" : {
36+ backgroundColor : "#3e3e4a" ,
37+ outline : "1px solid #9b6dd4"
38+ } ,
39+ ".cm-searchMatch.cm-searchMatch-selected" : {
40+ backgroundColor : "rgba(155, 109, 212, 0.3)"
41+ } ,
42+ ".cm-activeLine" : {
43+ backgroundColor : "#2e2e3a"
44+ } ,
45+ ".cm-selectionMatch" : {
46+ backgroundColor : "#3e3e4a"
47+ } ,
48+ ".cm-gutters" : {
49+ backgroundColor : "#262630" ,
50+ color : "#808090" ,
51+ border : "none"
52+ } ,
53+ ".cm-activeLineGutter" : {
54+ backgroundColor : "#2e2e3a"
55+ } ,
56+ ".cm-lineNumbers .cm-gutterElement" : {
57+ color : "#808090"
58+ }
59+ } ,
60+ { dark : true }
61+ ) ;
62+
63+ // Syntax highlighting with purple accent
64+ const crispyHighlight = HighlightStyle . define ( [
65+ { tag : tags . keyword , color : "#c9a6eb" } ,
66+ { tag : tags . operator , color : "#cdd6f4" } ,
67+ { tag : tags . variableName , color : "#89b4fa" } ,
68+ { tag : tags . propertyName , color : "#89b4fa" } ,
69+ { tag : tags . attributeName , color : "#89b4fa" } ,
70+ { tag : tags . className , color : "#89b4fa" } ,
71+ { tag : tags . tagName , color : "#c9a6eb" } ,
72+ { tag : tags . string , color : "#a6e3a1" } ,
73+ { tag : tags . number , color : "#fab387" } ,
74+ { tag : tags . bool , color : "#fab387" } ,
75+ { tag : tags . null , color : "#fab387" } ,
76+ { tag : tags . comment , color : "#6c7086" , fontStyle : "italic" } ,
77+ { tag : tags . bracket , color : "#cdd6f4" } ,
78+ { tag : tags . punctuation , color : "#cdd6f4" } ,
79+ { tag : tags . definition ( tags . variableName ) , color : "#89b4fa" } ,
80+ { tag : tags . function ( tags . variableName ) , color : "#89b4fa" } ,
81+ { tag : tags . atom , color : "#c9a6eb" } ,
82+ { tag : tags . unit , color : "#a6e3a1" } ,
83+ { tag : tags . color , color : "#f9e2af" }
84+ ] ) ;
85+
86+ // Combined theme export
87+ export const crispyEditorTheme = [ crispyTheme , syntaxHighlighting ( crispyHighlight ) ] ;
88+
89+ // Custom overrides for editor styling
1590const editorTheme = EditorView . theme (
1691 {
1792 "&" : {
@@ -51,7 +126,7 @@ export class CodeEditor {
51126 // Build extensions array
52127 const extensions = [
53128 langExtension ,
54- oneDark ,
129+ crispyEditorTheme ,
55130 editorTheme ,
56131 // History for undo/redo
57132 history ( ) ,
0 commit comments