Forge
csharp4405de34
1namespace CascadeIDE.Features.Editor.Application.Monaco;
2
3/// <summary>Maps Cascade UI theme to Monaco <c>defineTheme</c> (ADR 0163 M11).</summary>
4public static class MonacoEditorThemeMapper
5{
6 public const string CascadeDarkThemeId = "cascade-dark";
7
8 public static string ResolveThemeId(bool isDark) => isDark ? CascadeDarkThemeId : "vs";
9
10 public static object BuildDefineThemePayload(bool isDark) =>
11 isDark
12 ? new Dictionary<string, object>
13 {
14 ["base"] = "vs-dark",
15 ["inherit"] = true,
16 ["rules"] = Array.Empty<object>(),
17 ["colors"] = new Dictionary<string, string>
18 {
19 ["editor.background"] = "#1e1e1e",
20 ["editor.foreground"] = "#d4d4d4",
21 ["editorLineNumber.foreground"] = "#858585",
22 ["editor.selectionBackground"] = "#264f78",
23 ["editor.inactiveSelectionBackground"] = "#3a3d41",
24 },
25 }
26 : new Dictionary<string, object>
27 {
28 ["base"] = "vs",
29 ["inherit"] = true,
30 ["rules"] = Array.Empty<object>(),
31 ["colors"] = new Dictionary<string, string>
32 {
33 ["editor.background"] = "#ffffff",
34 ["editor.foreground"] = "#1e1e1e",
35 },
36 };
37}
38
View only · write via MCP/CIDE