Skip to content

Commit ee6dfc3

Browse files
authored
feat(ui): add CRT terminal theme (#133495)
New built-in Control UI theme family: white-on-black console with a phosphor-green accent and amber secondary, JetBrains Mono across chrome and chat, and a flattened corner-radius ladder for the terminal shape. Light mode is a neutral paper console. Registered across the theme registry, first-paint boot script, gateway-protocol profile wire contract, config schema, appearance grid, i18n, and the dark-family confirm-button list; WCAG audit in the palette header (dark body ~11.8:1, accent ~14.9:1, light accent 6.9:1).
1 parent e60b4ec commit ee6dfc3

19 files changed

Lines changed: 244 additions & 3 deletions

‎packages/gateway-protocol/src/schema/ui-appearance-preferences.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const UI_APPEARANCE_THEME_VALUES = [
2323
"tide",
2424
"beacon",
2525
"phosphor",
26+
"crt",
2627
] as const;
2728
// Wire-contract list of profile-storable typefaces. The Control UI derives
2829
// its override normalization from this tuple so browser and profile values agree.

‎src/config/types.openclaw.ts‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,16 @@ export type OpenClawConfig = {
156156
*/
157157
prefs?: {
158158
/** Control UI theme. */
159-
theme?: "claw" | "knot" | "dash" | "absolutely" | "tide" | "beacon" | "phosphor" | "custom";
159+
theme?:
160+
| "claw"
161+
| "knot"
162+
| "dash"
163+
| "absolutely"
164+
| "tide"
165+
| "beacon"
166+
| "phosphor"
167+
| "crt"
168+
| "custom";
160169
/** Light/dark preference. */
161170
themeMode?: "light" | "dark" | "system";
162171
/** User-selected Control UI accent color (#RRGGBB). */

‎src/config/zod-schema.root-shape.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ export const OpenClawSchemaShape = {
228228
z.literal("tide"),
229229
z.literal("beacon"),
230230
z.literal("phosphor"),
231+
z.literal("crt"),
231232
z.literal("custom"),
232233
])
233234
.optional(),

‎ui/index.html‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,16 @@
2121
globalThis.__zod_globalConfig.jitless = true;
2222

2323
(function () {
24-
var THEMES = { claw: 1, knot: 1, dash: 1, absolutely: 1, tide: 1, beacon: 1, phosphor: 1 };
24+
var THEMES = {
25+
claw: 1,
26+
knot: 1,
27+
dash: 1,
28+
absolutely: 1,
29+
tide: 1,
30+
beacon: 1,
31+
phosphor: 1,
32+
crt: 1,
33+
};
2534
var MODES = { system: 1, light: 1, dark: 1 };
2635
var LEGACY = {
2736
dark: "claw:dark",
@@ -60,6 +69,7 @@
6069
tide: ["tide", "tide-light"],
6170
beacon: ["beacon", "beacon-light"],
6271
phosphor: ["phosphor", "phosphor-light"],
72+
crt: ["crt", "crt-light"],
6373
};
6474
var pair = FAMILIES[theme];
6575
var resolved = pair
@@ -156,6 +166,14 @@
156166
background: #f4f7f4;
157167
}
158168

169+
html[data-theme="crt"] {
170+
background: #090a09;
171+
}
172+
173+
html[data-theme="crt-light"] {
174+
background: #f5f5f4;
175+
}
176+
159177
body {
160178
margin: 0;
161179
min-height: 100%;

‎ui/public/themes/crt.css‎

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
/* CRT palette; selected by index.html and app/theme.ts. */
2+
3+
/* Terminal shape: the whole console is near-square. Radius tokens flatten the
4+
var(--radius-*) chain and the scale factor flattens the fixed px * scale
5+
corner rules; --radius-full is untouched so avatars and pills stay round.
6+
The attribute selector outscores the :root capability flip to 1.25. */
7+
:root[data-theme="crt"],
8+
:root[data-theme="crt-light"] {
9+
--radius-sm: 2px;
10+
--radius-md: 3px;
11+
--radius-lg: 4px;
12+
--radius-xl: 6px;
13+
--radius: 3px;
14+
--openclaw-corner-radius-scale: 0.25;
15+
}
16+
17+
:root[data-theme="crt"] {
18+
/*
19+
* Accent — bright phosphor green on neutral tube black; white-cast body text.
20+
* Phosphor (green-on-green glass) stays the tinted sibling; CRT is the
21+
* neutral white/green console.
22+
*
23+
* WCAG 2.1 AA audit (bg = #090a09, relative luminance ≈ 0.0030):
24+
* --accent #3aff7d contrast ≈ 14.9:1 AAA ✓
25+
* --primary-foreground #052b12 on #3aff7d button: 11.6:1 ✓
26+
* --destructive-foreground (base #fafafa) on #d0342d button: 4.7:1 AA ✓
27+
* body text --text #c2cac3: 11.8:1 ✓
28+
* worst text pairing --muted on --bg-muted: 6.5:1 ✓
29+
*/
30+
--ring: #3aff7d;
31+
--accent: #3aff7d;
32+
--accent-hover: #71ffa5;
33+
--accent-muted: #3aff7d;
34+
--accent-subtle: rgba(58, 255, 125, 0.12);
35+
--accent-glow: rgba(58, 255, 125, 0.2);
36+
--primary: #3aff7d;
37+
--primary-hover: #71ffa5;
38+
--primary-foreground: #052b12;
39+
40+
--destructive: #d0342d;
41+
--destructive-hover: #b92d27;
42+
43+
--focus: rgba(58, 255, 125, 0.18);
44+
--focus-ring: 0 0 0 2px var(--bg), 0 0 0 3px color-mix(in srgb, var(--ring) 75%, transparent);
45+
--focus-glow: 0 0 0 2px var(--bg), 0 0 0 3px var(--ring), 0 0 16px var(--accent-glow);
46+
47+
--bg: #090a09;
48+
--bg-accent: #0d0f0d;
49+
--bg-elevated: #111412;
50+
--bg-hover: #171b18;
51+
--bg-muted: #151915;
52+
53+
--card: #0d0f0d;
54+
--card-foreground: #e9eee9;
55+
--card-highlight: rgba(220, 245, 225, 0.04);
56+
--popover: #111412;
57+
--popover-foreground: #e9eee9;
58+
59+
--panel: #090a09;
60+
--panel-strong: #111412;
61+
--panel-hover: #171b18;
62+
--chrome: rgba(9, 10, 9, 0.96);
63+
--chrome-strong: rgba(9, 10, 9, 0.98);
64+
65+
--text: #c2cac3;
66+
--text-strong: #e9eee9;
67+
--chat-text: #c2cac3;
68+
--muted: #90a094;
69+
--muted-strong: #a3b2a7;
70+
--muted-foreground: #90a094;
71+
72+
--border: #202521;
73+
--border-strong: #303833;
74+
--border-hover: #45524a;
75+
--input: #202521;
76+
77+
--secondary: #0d0f0d;
78+
--secondary-foreground: #e9eee9;
79+
--accent-2: #ffcf5c;
80+
--accent-2-muted: rgba(255, 207, 92, 0.7);
81+
--accent-2-subtle: rgba(255, 207, 92, 0.12);
82+
83+
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
84+
--shadow-md: 0 4px 16px rgba(0, 0, 0, 0.55);
85+
--shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.65);
86+
--overlay-shadow: var(--shadow-md);
87+
88+
--grid-line: rgba(220, 245, 225, 0.04);
89+
90+
/* One face for the whole console, prose included — same opt-in character
91+
decision as Phosphor; the mono choice is why this theme is not a default. */
92+
--mono:
93+
"JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
94+
--font-body: var(--mono);
95+
--font-chat: var(--mono);
96+
}
97+
98+
:root[data-theme="crt-light"] {
99+
/*
100+
* Accent — deep console green on neutral paper.
101+
*
102+
* WCAG 2.1 AA audit (bg = #f5f5f4, relative luminance ≈ 0.911):
103+
* --accent #0a612b contrast ≈ 6.9:1 AA ✓
104+
* --primary-foreground #ffffff on #0a612b button: 7.6:1 ✓
105+
* body text --text #343a34: 10.7:1 ✓
106+
* worst text pairing --muted on --bg-muted: 5.1:1 ✓
107+
*/
108+
--ring: #0a612b;
109+
--accent: #0a612b;
110+
--accent-hover: #084d22;
111+
--accent-muted: #0a612b;
112+
--accent-subtle: rgba(10, 97, 43, 0.1);
113+
--accent-glow: rgba(10, 97, 43, 0.14);
114+
--primary: #0a612b;
115+
--primary-foreground: #ffffff;
116+
117+
--bg: #f5f5f4;
118+
--bg-accent: #ececea;
119+
--bg-elevated: #ffffff;
120+
--bg-hover: #e3e4e1;
121+
--bg-muted: #e9eae8;
122+
--bg-content: #efefee;
123+
124+
--card: #ffffff;
125+
--card-foreground: #191e19;
126+
--card-highlight: rgba(20, 40, 25, 0.02);
127+
--popover: #ffffff;
128+
--popover-foreground: #191e19;
129+
--session-hovercard-surface: var(--card);
130+
--session-hovercard-progress-surface: color-mix(
131+
in srgb,
132+
var(--card) 52%,
133+
var(--panel-strong) 48%
134+
);
135+
136+
--panel: #f5f5f4;
137+
--panel-strong: #ececea;
138+
--panel-hover: #dddedb;
139+
--chrome: rgba(245, 245, 244, 0.96);
140+
--chrome-strong: rgba(245, 245, 244, 0.98);
141+
142+
--text: #343a34;
143+
--text-strong: #191e19;
144+
--chat-text: #343a34;
145+
--muted: #5b655c;
146+
--muted-strong: #49544a;
147+
--muted-foreground: #5b655c;
148+
149+
--border: #dcdedb;
150+
--border-strong: #c0c5bf;
151+
--border-hover: #97a399;
152+
--input: #dcdedb;
153+
154+
--secondary: #ececea;
155+
--secondary-foreground: #343a34;
156+
--accent-2: #7a5d10;
157+
--accent-2-muted: rgba(122, 93, 16, 0.75);
158+
--accent-2-subtle: rgba(122, 93, 16, 0.08);
159+
160+
--shadow-sm: 0 1px 2px rgba(15, 25, 18, 0.05);
161+
--shadow-md: 0 4px 12px rgba(15, 25, 18, 0.07);
162+
--shadow-lg: 0 12px 28px rgba(15, 25, 18, 0.09);
163+
--overlay-shadow: var(--shadow-md);
164+
165+
--grid-line: rgba(20, 40, 25, 0.04);
166+
167+
--mono:
168+
"JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
169+
--font-body: var(--mono);
170+
--font-chat: var(--mono);
171+
}

‎ui/src/app/mount-fallback.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ describe("Control UI mount fallback", () => {
112112
["Beacon dark", { theme: "beacon", themeMode: "dark" }, "beacon", "rgb(0, 0, 0)"],
113113
["Beacon light", { theme: "beacon", themeMode: "light" }, "beacon-light", "rgb(255, 255, 255)"],
114114
["Phosphor dark", { theme: "phosphor", themeMode: "dark" }, "phosphor", "rgb(10, 15, 10)"],
115+
["CRT dark", { theme: "crt", themeMode: "dark" }, "crt", "rgb(9, 10, 9)"],
116+
["CRT light", { theme: "crt", themeMode: "light" }, "crt-light", "rgb(245, 245, 244)"],
115117
])(
116118
"paints %s before the app stylesheet loads",
117119
async (_name, settings, expectedTheme, expectedBackground) => {

‎ui/src/app/server-prefs.profile.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ describe("profile-bound appearance preferences", () => {
5252
tide: true,
5353
beacon: true,
5454
phosphor: true,
55+
crt: true,
5556
custom: false,
5657
};
5758
for (const [theme, storable] of Object.entries(profileStorable)) {

‎ui/src/app/theme-fonts.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ describe("typeface presentation", () => {
3131
["tide", ["ibm-plex-sans", "ibm-plex-sans"]],
3232
["beacon", ["atkinson-hyperlegible", "atkinson-hyperlegible"]],
3333
["phosphor", ["jetbrains-mono", "jetbrains-mono"]],
34+
["crt", ["jetbrains-mono", "jetbrains-mono"]],
3435
["custom", ["system", "system"]],
3536
] as const)("loads %s's default faces plus the shared mono face", (theme, [ui, chat]) => {
3637
const faces = resolveTypefaces(theme);

‎ui/src/app/theme.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ describe("resolveTheme", () => {
1212
["tide", "tide", "tide-light"],
1313
["beacon", "beacon", "beacon-light"],
1414
["phosphor", "phosphor", "phosphor-light"],
15+
["crt", "crt", "crt-light"],
1516
["custom", "custom", "custom-light"],
1617
] satisfies [ThemeName, string, string][])(
1718
"resolves %s in both explicit modes",

‎ui/src/app/theme.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export type ThemeName =
88
| "tide"
99
| "beacon"
1010
| "phosphor"
11+
| "crt"
1112
| "custom";
1213
export type ThemeMode = "system" | "light" | "dark";
1314
export type ResolvedTheme =
@@ -25,6 +26,8 @@ export type ResolvedTheme =
2526
| "beacon-light"
2627
| "phosphor"
2728
| "phosphor-light"
29+
| "crt"
30+
| "crt-light"
2831
| "custom"
2932
| "custom-light";
3033

@@ -36,6 +39,7 @@ const VALID_THEME_NAMES = new Set<ThemeName>([
3639
"tide",
3740
"beacon",
3841
"phosphor",
42+
"crt",
3943
"custom",
4044
]);
4145

0 commit comments

Comments
 (0)