Skip to content

Commit 08a42a5

Browse files
authored
feat(control-ui): add the Tide, Beacon, and Phosphor themes (#130232)
* chore(control-ui): vendor JetBrains Mono and Atkinson Hyperlegible Next Adds the woff2 faces for the Beacon and Phosphor themes plus the stylesheets that declare them. Both families are SIL Open Font License 1.1 and ship unmodified with their upstream license text, as the license requires. Atkinson Hyperlegible Next was drawn by the Braille Institute for low vision: its letterforms disambiguate the pairs that blur first at low acuity (I/l/1, O/0, rn/m), which is why it belongs to the accessibility theme specifically. base.css has always named JetBrains Mono first in --mono, but nothing shipped it, so code blocks rendered in it only for people who happened to have it installed locally. Phosphor makes that deterministic. Latin and latin-ext subsets only, 195 KB. Served from the gateway rather than a font CDN so font-src 'self' holds, no third-party request happens on load, and an offline or LAN-only gateway still renders correctly. The url() references are relative to their stylesheet so they follow a configured Control UI mount. * feat(control-ui): add the Tide, Beacon, and Phosphor themes Three built-in themes, each filling a gap the existing four share rather than adding a fifth variation on them. Every shipped accent today is warm — coral, crimson, chocolate, clay — and the only cool token anywhere is Claw's teal secondary. Tide is the cool one: steel cyan on deep slate, deep teal-blue on cool paper. It deliberately ships no webfonts, so it costs nothing beyond its tokens. Beacon is the accessibility one. It targets WCAG AAA (7:1) rather than the AA 4.5:1 floor the other themes hold, for low vision, direct sunlight, projectors, and poor panels, and sets everything in Atkinson Hyperlegible Next. Reaching AAA forced one deliberate break from the status-token convention: elsewhere each --x-subtle is --x at 8%, but a label on a tint of its own hue caps achievable contrast because the tint pulls the background toward the text. Beacon tints neutrally and lets the label carry the contrast. Its focus ring is opaque and 3px for the same reason — a translucent ring is the first thing to vanish on a bad panel. The contrast guardrail now enforces 7:1 for Beacon specifically, so a later palette edit cannot quietly demote it to an ordinary dark theme. Phosphor is the terminal one: phosphor green on green-cast black with the whole surface, chat prose included, in JetBrains Mono. Monospace prose is a character choice for an operator console, not a readability claim, which is why it is opt-in. Every palette was solved against the real guardrail before any CSS was written. Worst text pairing per theme: Tide 6.12:1 dark / 4.63:1 light, Beacon 10.29:1 / 9.72:1, Phosphor 6.69:1 / 4.76:1. Worst status label on its own tint: Beacon 7.05:1 / 7.02:1, the others above 4.6:1. Budgets: the startup CSS ceiling moves 45 -> 47 KiB and the JS ratchet baseline moves 523 B. Every built-in theme's tokens ship in the startup sheet, so each new theme costs ~0.5 KiB gzip whether or not anyone selects it. Moving per-theme palettes to lazily linked stylesheets (as theme webfonts already are) would take this back under the old ceiling, but it needs a first-paint story first: a late palette flashes default colors where a late font only swaps. * fix(control-ui): use Beacon's destructive foreground in chat confirmations The chat confirmation button paints from --danger under --media-foreground, a theme-invariant white, and each dark palette opts out of that pairing through a selector list in chat/grouped.css. Beacon defines a deliberately light --danger (#ffabab, chosen so status labels clear AAA) but was missing from that list, so its confirm button rendered white on pale pink at 1.80:1 — on the theme whose entire promise is contrast. Adds Beacon to the list, which routes it to --destructive over --destructive-foreground at 11.67:1. Also adds a guardrail for the bug class, since the selector list has to be extended by hand for every new dark theme and I have now missed it once. The test reads membership back out of grouped.css rather than restating it, resolves each theme's effective (background, color) pair, and holds it to that theme's floor. It reproduces this defect at 1.80:1 against the pre-fix stylesheet. Reported by ClawSweeper review on #130232.
1 parent d27d822 commit 08a42a5

30 files changed

Lines changed: 1139 additions & 20 deletions
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"startupJsGzipBytes": 340810,
3-
"reason": "sidebar gateway status pill rebased onto the composer-queue main: combined tree measures 340754-340770 B; pinned with jitter headroom",
2+
"startupJsGzipBytes": 341333,
3+
"reason": "Tide, Beacon, and Phosphor themes: theme-name wiring, three appearance options, locale strings, and two font stylesheet mappings",
44
"updatedAt": "2026-08-26"
55
}

‎docs/web/control-ui.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ Docs translations are generated for the same non-English locale set, but the doc
149149

150150
## Appearance themes
151151

152-
The Appearance panel has the built-in Claw, Knot, Dash, and Absolutely themes (Claw is default), plus one browser-local tweakcn import slot. To import a theme, open the [tweakcn editor](https://tweakcn.com/editor/theme), choose or create a theme, click **Share**, and paste the copied link into Appearance. The importer also accepts `https://tweakcn.com/r/themes/<id>` registry URLs, editor URLs like `https://tweakcn.com/editor/theme?theme=amethyst-haze`, relative `/themes/<id>` paths, raw theme IDs, and default theme names such as `amethyst-haze`.
152+
The Appearance panel has the built-in Claw, Knot, Dash, Absolutely, Tide, Beacon, and Phosphor themes (Claw is default), plus one browser-local tweakcn import slot. Beacon targets WCAG AAA (7:1) contrast with the Atkinson Hyperlegible Next typeface for low vision, bright sunlight, projectors, and low-quality panels; Phosphor sets the entire surface, chat prose included, in JetBrains Mono. To import a theme, open the [tweakcn editor](https://tweakcn.com/editor/theme), choose or create a theme, click **Share**, and paste the copied link into Appearance. The importer also accepts `https://tweakcn.com/r/themes/<id>` registry URLs, editor URLs like `https://tweakcn.com/editor/theme?theme=amethyst-haze`, relative `/themes/<id>` paths, raw theme IDs, and default theme names such as `amethyst-haze`.
153153

154154
Imported themes are stored only in the current browser profile; they are not written to gateway config and do not sync across devices. Replacing the imported theme updates the one local slot; clearing it switches back to Claw if the imported theme was active.
155155

‎scripts/check-control-ui-performance.mts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@ const controlUiPerformanceBudgets = {
3131
startupJsGzipBytes: 350 * KIB,
3232
// 45 KiB CSS ceilings maintainer-approved 2026-07 alongside the interleaved
3333
// sidebar zone styling; headroom over the ~36.5 KiB post-diet baseline.
34-
startupCssGzipBytes: 45 * KIB,
34+
// Raised to 47 KiB 2026-08-26 for the Tide/Beacon/Phosphor palettes: every
35+
// built-in theme's tokens ship in the startup sheet, so each new theme costs
36+
// ~0.5 KiB gzip whether or not anyone selects it. Moving per-theme palettes
37+
// to lazily linked stylesheets (as theme webfonts already are) would take
38+
// this back under the old ceiling; it needs a first-paint story first, since
39+
// a late palette flashes default colors where a late font only swaps.
40+
startupCssGzipBytes: 47 * KIB,
3541
largestJsGzipBytes: 215 * KIB,
3642
// Composer multiline surface (stack #124301) legitimately grew boot CSS;
3743
// operator decision 2026-08-25 rejected boot splitting due to precedence risk.

‎src/config/types.openclaw.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export type OpenClawConfig = {
156156
*/
157157
prefs?: {
158158
/** Control UI theme. */
159-
theme?: "claw" | "knot" | "dash" | "absolutely" | "custom";
159+
theme?: "claw" | "knot" | "dash" | "absolutely" | "tide" | "beacon" | "phosphor" | "custom";
160160
/** Light/dark preference. */
161161
themeMode?: "light" | "dark" | "system";
162162
/** User-selected Control UI accent color (#RRGGBB). */

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ export const OpenClawSchemaShape = {
225225
z.literal("knot"),
226226
z.literal("dash"),
227227
z.literal("absolutely"),
228+
z.literal("tide"),
229+
z.literal("beacon"),
230+
z.literal("phosphor"),
228231
z.literal("custom"),
229232
])
230233
.optional(),

‎ui/index.html‎

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
globalThis.__zod_globalConfig.jitless = true;
2222

2323
(function () {
24-
var THEMES = { claw: 1, knot: 1, dash: 1, absolutely: 1 };
24+
var THEMES = { claw: 1, knot: 1, dash: 1, absolutely: 1, tide: 1, beacon: 1, phosphor: 1 };
2525
var MODES = { system: 1, light: 1, dark: 1 };
2626
var LEGACY = {
2727
dark: "claw:dark",
@@ -65,9 +65,21 @@
6565
? mode === "light"
6666
? "absolutely-light"
6767
: "absolutely"
68-
: mode === "light"
69-
? "light"
70-
: "dark";
68+
: theme === "tide"
69+
? mode === "light"
70+
? "tide-light"
71+
: "tide"
72+
: theme === "beacon"
73+
? mode === "light"
74+
? "beacon-light"
75+
: "beacon"
76+
: theme === "phosphor"
77+
? mode === "light"
78+
? "phosphor-light"
79+
: "phosphor"
80+
: mode === "light"
81+
? "light"
82+
: "dark";
7183
document.documentElement.setAttribute("data-theme", resolved);
7284
var resolvedMode = resolved.includes("light") ? "light" : "dark";
7385
document.documentElement.setAttribute("data-theme-mode", resolvedMode);
@@ -118,6 +130,30 @@
118130
background: #faf9f5;
119131
}
120132

133+
html[data-theme="tide"] {
134+
background: #10151b;
135+
}
136+
137+
html[data-theme="tide-light"] {
138+
background: #f7f9fb;
139+
}
140+
141+
html[data-theme="beacon"] {
142+
background: #000000;
143+
}
144+
145+
html[data-theme="beacon-light"] {
146+
background: #ffffff;
147+
}
148+
149+
html[data-theme="phosphor"] {
150+
background: #0a0f0a;
151+
}
152+
153+
html[data-theme="phosphor-light"] {
154+
background: #f4f7f4;
155+
}
156+
121157
body {
122158
margin: 0;
123159
min-height: 100%;
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
Copyright 2020-2024 The Atkinson Hyperlegible Next Project Authors (https://github.com/googlefonts/atkinson-hyperlegible-next)
2+
3+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
4+
This license is copied below, and is also available with a FAQ at:
5+
https://openfontlicense.org
6+
7+
8+
-----------------------------------------------------------
9+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10+
-----------------------------------------------------------
11+
12+
PREAMBLE
13+
The goals of the Open Font License (OFL) are to stimulate worldwide
14+
development of collaborative font projects, to support the font creation
15+
efforts of academic and linguistic communities, and to provide a free and
16+
open framework in which fonts may be shared and improved in partnership
17+
with others.
18+
19+
The OFL allows the licensed fonts to be used, studied, modified and
20+
redistributed freely as long as they are not sold by themselves. The
21+
fonts, including any derivative works, can be bundled, embedded,
22+
redistributed and/or sold with any software provided that any reserved
23+
names are not used by derivative works. The fonts and derivatives,
24+
however, cannot be released under any other type of license. The
25+
requirement for fonts to remain under this license does not apply
26+
to any document created using the fonts or their derivatives.
27+
28+
DEFINITIONS
29+
"Font Software" refers to the set of files released by the Copyright
30+
Holder(s) under this license and clearly marked as such. This may
31+
include source files, build scripts and documentation.
32+
33+
"Reserved Font Name" refers to any names specified as such after the
34+
copyright statement(s).
35+
36+
"Original Version" refers to the collection of Font Software components as
37+
distributed by the Copyright Holder(s).
38+
39+
"Modified Version" refers to any derivative made by adding to, deleting,
40+
or substituting -- in part or in whole -- any of the components of the
41+
Original Version, by changing formats or by porting the Font Software to a
42+
new environment.
43+
44+
"Author" refers to any designer, engineer, programmer, technical
45+
writer or other person who contributed to the Font Software.
46+
47+
PERMISSION & CONDITIONS
48+
Permission is hereby granted, free of charge, to any person obtaining
49+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
50+
redistribute, and sell modified and unmodified copies of the Font
51+
Software, subject to the following conditions:
52+
53+
1) Neither the Font Software nor any of its individual components,
54+
in Original or Modified Versions, may be sold by itself.
55+
56+
2) Original or Modified Versions of the Font Software may be bundled,
57+
redistributed and/or sold with any software, provided that each copy
58+
contains the above copyright notice and this license. These can be
59+
included either as stand-alone text files, human-readable headers or
60+
in the appropriate machine-readable metadata fields within text or
61+
binary files as long as those fields can be easily viewed by the user.
62+
63+
3) No Modified Version of the Font Software may use the Reserved Font
64+
Name(s) unless explicit written permission is granted by the corresponding
65+
Copyright Holder. This restriction only applies to the primary font name as
66+
presented to the users.
67+
68+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69+
Software shall not be used to promote, endorse or advertise any
70+
Modified Version, except to acknowledge the contribution(s) of the
71+
Copyright Holder(s) and the Author(s) or with their explicit written
72+
permission.
73+
74+
5) The Font Software, modified or unmodified, in part or in whole,
75+
must be distributed entirely under this license, and must not be
76+
distributed under any other license. The requirement for fonts to
77+
remain under this license does not apply to any document created
78+
using the Font Software.
79+
80+
TERMINATION
81+
This license becomes null and void if any of the above conditions are
82+
not met.
83+
84+
DISCLAIMER
85+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93+
OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file not shown.
36.7 KB
Binary file not shown.
18.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)