Skip to content

Commit a278b38

Browse files
author
Factory Bot
committed
feat: apply Figma syntax highlighting colors to Monaco editor
1 parent 56e5854 commit a278b38

File tree

2 files changed

+48
-42
lines changed

2 files changed

+48
-42
lines changed

cortex-gui/src/context/ThemeContext.tsx

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -184,22 +184,22 @@ const lightColors: ThemeColors = {
184184
borderActive: "#d4d4d8",
185185
};
186186

187-
// JetBrains Dark Editor Colors
187+
// Figma Design Editor Colors
188188
const darkEditorColors: EditorColors = {
189-
editorBackground: "#18181a",
190-
editorForeground: "#D8DEE9",
191-
editorLineHighlight: "#292929",
192-
editorSelectionBackground: "#40404099",
193-
editorSelectionForeground: "#ffffff",
189+
editorBackground: "#1A1B1F", // Figma card background
190+
editorForeground: "#FFFFFF", // White text
191+
editorLineHighlight: "rgba(255,255,255,0.05)",
192+
editorSelectionBackground: "rgba(255,255,255,0.15)",
193+
editorSelectionForeground: "#FFFFFF",
194194
editorCursor: "#FFFFFF",
195-
editorWhitespace: "#505050B3",
196-
editorIndentGuide: "#404040B3",
197-
editorIndentGuideActive: "#505050",
198-
editorLineNumber: "#505050",
195+
editorWhitespace: "rgba(255,255,255,0.1)",
196+
editorIndentGuide: "rgba(255,255,255,0.05)",
197+
editorIndentGuideActive: "rgba(255,255,255,0.1)",
198+
editorLineNumber: "rgba(255,255,255,0.5)", // Figma line numbers
199199
editorLineNumberActive: "#FFFFFF",
200-
editorRuler: "#494949",
201-
editorGutter: "#1a1a1a",
202-
editorFoldBackground: "#292929",
200+
editorRuler: "rgba(255,255,255,0.1)",
201+
editorGutter: "#1A1B1F",
202+
editorFoldBackground: "rgba(255,255,255,0.05)",
203203
};
204204

205205
const lightEditorColors: EditorColors = {
@@ -219,25 +219,26 @@ const lightEditorColors: EditorColors = {
219219
editorFoldBackground: "#f4f4f5",
220220
};
221221

222+
// Figma Design Exact Syntax Colors
222223
const darkSyntaxColors: SyntaxColors = {
223-
comment: "#6b7280",
224-
string: "#86efac",
225-
number: "#fcd34d",
226-
keyword: "#c4b5fd",
227-
operator: "#e4e4e7",
228-
function: "#93c5fd",
229-
variable: "#f0abfc",
230-
type: "#67e8f9",
231-
class: "#fbbf24",
232-
constant: "#fb923c",
233-
parameter: "#fdba74",
234-
property: "#a5b4fc",
235-
punctuation: "#a1a1aa",
236-
tag: "#f472b6",
237-
attribute: "#67e8f9",
238-
regexp: "#f87171",
239-
escape: "#fbbf24",
240-
invalid: "#ef4444",
224+
comment: "rgba(255,255,255,0.5)", // Line numbers, comments
225+
string: "#8EFF96", // Strings, template literals
226+
number: "#8EFF96", // Numbers
227+
keyword: "#FEAB78", // const, typeof, if, false, true
228+
operator: "#FFFFFF", // =, ===, &&, ||
229+
function: "#66BFFF", // useTranslation, useState, Object.keys
230+
variable: "#FFFFFF", // Default text
231+
type: "#FEAB78", // <boolean>, type annotations
232+
class: "#66BFFF", // Class names
233+
constant: "#FEAB78", // false, true, null
234+
parameter: "#FFFFFF", // Function parameters
235+
property: "#FFB7FA", // .length, .household, .members
236+
punctuation: "#FFFFFF", // (), {}, []
237+
tag: "#FEAB78", // JSX tags
238+
attribute: "#FFB7FA", // JSX attributes
239+
regexp: "#8EFF96", // Regular expressions
240+
escape: "#FEAB78", // Escape sequences
241+
invalid: "#ef4444", // Invalid code
241242
};
242243

243244
const lightSyntaxColors: SyntaxColors = {

cortex-gui/src/styles/figma-tokens.css

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -501,18 +501,23 @@
501501
--figma-skeleton-highlight: var(--figma-bg-hover);
502502

503503
/* ===========================================================================
504-
CODE/SYNTAX HIGHLIGHTING
504+
CODE/SYNTAX HIGHLIGHTING - Figma Design Exact Colors
505505
=========================================================================== */
506-
--figma-syntax-keyword: #FF79C6;
507-
--figma-syntax-string: #50FA7B;
508-
--figma-syntax-number: #BD93F9;
509-
--figma-syntax-comment: #6272A4;
510-
--figma-syntax-function: #8BE9FD;
511-
--figma-syntax-variable: #F8F8F2;
512-
--figma-syntax-type: #FFB86C;
513-
--figma-syntax-constant: #BD93F9;
514-
--figma-syntax-operator: #FF79C6;
515-
--figma-syntax-bracket: #F8F8F2;
506+
--figma-syntax-keyword: #FEAB78; /* const, typeof, if, false, true */
507+
--figma-syntax-string: #8EFF96; /* "object", template literals, numbers */
508+
--figma-syntax-number: #8EFF96; /* 0, 1, numeric values */
509+
--figma-syntax-comment: rgba(255,255,255,0.5); /* Comments, line numbers */
510+
--figma-syntax-function: #66BFFF; /* useTranslation, useState, Object.keys */
511+
--figma-syntax-variable: #FFFFFF; /* Default text, variables */
512+
--figma-syntax-type: #FEAB78; /* <boolean>, type annotations */
513+
--figma-syntax-constant: #FEAB78; /* false, true, null */
514+
--figma-syntax-operator: #FFFFFF; /* =, ===, &&, || */
515+
--figma-syntax-bracket: #FFFFFF; /* (), {}, [] */
516+
--figma-syntax-property: #FFB7FA; /* .length, .household, .members */
517+
--figma-syntax-parameter: #FFFFFF; /* Function parameters */
518+
--figma-syntax-line-number: rgba(255,255,255,0.5);
519+
--figma-syntax-type-hint-bg: rgba(255,255,255,0.05);
520+
--figma-syntax-type-hint-text: rgba(255,255,255,0.5);
516521
}
517522

518523
/* ===========================================================================

0 commit comments

Comments
 (0)