Skip to content

Commit c428193

Browse files
committed
feat: New colors for the monaco editor
1 parent ef25110 commit c428193

File tree

3 files changed

+79
-40
lines changed

3 files changed

+79
-40
lines changed

src/frontend/styles/components/text_editor.styl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
.margin-view-overlays
88
height: 100%
99

10-
div
11-
background-color: SECONDARY_BASE
10+
// div
11+
// background-color: SECONDARY_BASE
1212

1313
.monaco-editor .margin .margin-view-overlays .folding
1414
margin-left: 15px !important
15-
background-color: transparent
15+
// background-color: transparent
1616
width: 5px !important
1717

1818
.sticky-widget
@@ -76,7 +76,7 @@
7676
// width: 8px !important
7777

7878
.monaco-editor, .monaco-editor-background, .monaco-editor .inputarea.ime-input, .monaco-editor .margin, .monaco-editor .sticky-line-content, .monaco-editor .sticky-line-number
79-
background-color: transparent !important
79+
// background-color: transparent !important
8080
z-index: 2
8181

8282
.monaco-scrollable-element
@@ -91,7 +91,7 @@
9191

9292
.monaco-editor-background
9393
overflow: visible !important
94-
background-color: inherit !important
94+
// background-color: inherit !important
9595
contain: unset !important
9696

9797

src/frontend/ui/trace.nim

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -658,10 +658,11 @@ proc editorLineNumber*(self: EditorViewComponent, path: cstring, line: int, isDe
658658

659659
proc updateLineNumbersOnly*(self: EditorViewComponent) =
660660
let editorInstance = self.monacoEditor
661-
var currentOptions = editorInstance.getOptions()
661+
if not editorInstance.isNil:
662+
var currentOptions = editorInstance.getOptions()
662663

663-
currentOptions["lineNumbers"] = proc(line: int): cstring = self.editorLineNumber(self.path, line)
664-
editorInstance.updateOptions(cast[MonacoEditorOptions](currentOptions))
664+
currentOptions["lineNumbers"] = proc(line: int): cstring = self.editorLineNumber(self.path, line)
665+
editorInstance.updateOptions(cast[MonacoEditorOptions](currentOptions))
665666

666667
proc toggleTraceState*(self: TraceComponent) =
667668
self.api.emit(CtTracepointToggle, TracepointId(id: self.id))

src/public/third_party/monaco-themes/themes/customThemes/json/codetracerDark.json

Lines changed: 70 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@
77
"token": ""
88
},
99
{
10-
"foreground": "FB923C",
10+
"foreground": "78A96C",
1111
"token": "comment"
1212
},
1313
{
14-
"foreground": "FB923C",
15-
"fontStyle": "underline",
14+
"foreground": "86B77A",
1615
"token": "comment.doc"
1716
},
17+
{
18+
"foreground": "6FB6D9",
19+
"token": "comment.tag"
20+
},
1821
{
1922
"foreground": "cdd3de",
2023
"token": "variable"
@@ -24,15 +27,19 @@
2427
"token": "variable.name"
2528
},
2629
{
27-
"foreground": "A5D6FF",
30+
"foreground": "B38BC8",
31+
"token": "variable.readOnly"
32+
},
33+
{
34+
"foreground": "D9E2D4",
2835
"token": "variable.parameter"
2936
},
3037
{
3138
"foreground": "cdd3de",
3239
"token": "variable.member"
3340
},
3441
{
35-
"foreground": "DCDCAA",
42+
"foreground": "D7C98A",
3643
"token": "variable.member.function"
3744
},
3845
{
@@ -41,61 +48,65 @@
4148
"token": "variable.language"
4249
},
4350
{
44-
"foreground": "22D3EE",
51+
"foreground": "5A9DD4",
4552
"token": "keyword"
4653
},
4754
{
48-
"foreground": "22D3EE",
55+
"foreground": "C7D0DA",
4956
"token": "keyword.operator"
5057
},
58+
{
59+
"foreground": "C7D0DA",
60+
"token": "operator"
61+
},
5162
{
5263
"foreground": "22D3EE",
5364
"fontStyle": "bold",
5465
"token": "keyword.type"
5566
},
5667
{
57-
"foreground": "cd536d",
68+
"foreground": "63CBB6",
5869
"token": "type"
5970
},
6071
{
61-
"foreground": "cd536d",
72+
"foreground": "CDD6DF",
6273
"token": "type.identifier"
6374
},
6475
{
65-
"foreground": "BBF7D0",
76+
"foreground": "D6A38D",
6677
"token": "string"
6778
},
6879
{
69-
"foreground": "BBF7D0",
80+
"foreground": "D0B07A",
81+
"token": "string.escape"
82+
},
83+
{
84+
"foreground": "BFD8B0",
7085
"token": "number"
7186
},
7287
{
73-
"foreground": "BBF7D0",
88+
"foreground": "BFD8B0",
7489
"token": "number.hex"
7590
},
7691
{
77-
"foreground": "BBF7D0",
92+
"foreground": "BFD8B0",
7893
"token": "number.octal"
7994
},
8095
{
81-
"foreground": "BBF7D0",
96+
"foreground": "BFD8B0",
8297
"token": "number.binary"
8398
},
8499
{
85-
"foreground": "BBF7D0",
100+
"foreground": "BFD8B0",
86101
"token": "number.float"
87102
},
88103
{
89-
"foreground": "F3F3F3",
104+
"foreground": "B6C0CB",
90105
"token": "delimiter"
91106
},
92107
{
93-
"foreground": "F3F3F3",
94-
"token": "delimiter.backtick"
95-
},
96-
{
97-
"foreground": "F3F3F3",
98-
"token": "operator"
108+
"foreground": "C5CFDA",
109+
"token": "delimiter.bracket"
99110
},
100111
{
101112
"foreground": "FFA657",
@@ -108,26 +119,30 @@
108119
"token": "entity.name.type"
109120
},
110121
{
111-
"foreground": "DCDCAA",
122+
"foreground": "D7C98A",
112123
"fontStyle": "bold",
113124
"token": "entity.name.function"
114125
},
115126
{
116-
"foreground": "DCDCAA",
127+
"foreground": "D7C98A",
117128
"token": "identifier.function"
118129
},
119130
{
120-
"foreground": "DCDCAA",
131+
"foreground": "D7C98A",
121132
"token": "support.function"
122133
},
123134
{
124-
"foreground": "9CDCFE",
135+
"foreground": "7AA2D6",
125136
"token": "constant"
126137
},
127138
{
128139
"foreground": "C586C0",
129140
"token": "namespace"
130141
},
142+
{
143+
"foreground": "D47E7E",
144+
"token": "regexp"
145+
},
131146
{
132147
"foreground": "FF7B72",
133148
"fontStyle": "bold",
@@ -151,8 +166,16 @@
151166
"token": "metatag"
152167
},
153168
{
154-
"foreground": "9CDCFE",
169+
"foreground": "66A7DD",
170+
"token": "tag"
171+
},
172+
{
173+
"foreground": "8FCBEE",
155174
"token": "attribute.name"
175+
},
176+
{
177+
"foreground": "D6A38D",
178+
"token": "attribute.value"
156179
}
157180
],
158181
"colors": {
@@ -162,17 +185,32 @@
162185
"editorBracketHighlight.foreground4": "#EAB308",
163186
"editorBracketHighlight.foreground5": "#8B5CF6",
164187
"editorBracketHighlight.foreground6": "#3B82F6",
165-
"editor.foreground": "#2c2c2c",
166-
"editor.background": "#2c2c2c",
188+
"editor.foreground": "#CDD6DF",
189+
"editor.background": "#1F2124",
167190
"editor.selectionBackground": "#3a3a3ab3",
168191
"editor.lineHighlightBackground": "#3A3A3AB3",
169-
"editorCursor.foreground": "#c0c5ce",
170192
"editorWhitespace.foreground": "#65737e",
171193
"editorIndentGuide.background": "#65737F",
172194
"editorIndentGuide.activeBackground": "#FBC95A",
173195
"editorSuggestWidget.foreground": "#8e8f92",
174196
"editorSuggestWidget.background": "#2c2c2c",
175-
"editorLineNumber.foreground": "#919191",
176-
"focusBorder": "#2c2c2c"
197+
"editorLineNumber": "#646464",
198+
"activeLineNumber": "#CDD6DF",
199+
"selection": "#2A4B73",
200+
"inactiveSelection": "#253F60",
201+
"selectionHighlight": "#2A4B73",
202+
"lineHighlight": "#3A3A3A",
203+
"bracketMatch.background": "#2A2D31",
204+
"bracketMatch.border": "#4DA6D8",
205+
"editorWhitespace": "#3B3F45",
206+
"editorIndentGuide": "#4C5158",
207+
"findMatch": "#3A5166",
208+
"findMatchHighlight": "#2B2F36",
209+
"error": "#E06C75",
210+
"warning": "#E5B567",
211+
"info": "#6FB6D9",
212+
"hint": "#B38BC8",
213+
"focusBorder": "#2c2c2c",
214+
"editorCursor.foreground": "#F2F6FA"
177215
}
178216
}

0 commit comments

Comments
 (0)