@devries-cameron20 / t3code-1 / commits / 9d28fc921b
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

feat(themes): theme CSS can hold 100,000 characters (#37781)

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>

Theo Browne committed Nov 16, 2026 at 19:09 UTC 9d28fc921be19a7314376f6438242dcb838eb221
5 files changed +6 -5
apps/server/src/environmentTheme.test.ts
+1 -1
@@ -356,7 +356,7 @@ it.layer(NodeServices.layer)("environment theme", (it) => {
356 return withEnvironmentThemes(
357 {
358 ...Object.fromEntries(
359 - Array.from({ length: 6 }, (_, index) => [
359 + Array.from({ length: 3 }, (_, index) => [
360 `aa-${index}.json`,
361 encodeThemeFileEscaped(large(`Large ${index}`)),
362 ]),
apps/server/src/environmentTheme.ts
+2 -1
@@ -55,7 +55,8 @@ const MAX_THEME_FILES = 32;
55 * JSON encoding, at up to 6 bytes per character for a `\uXXXX` escape, plus the colors.
56 */
57 export const MAX_THEME_FILE_BYTES = 6 * THEME_CSS_MAX_LENGTH + 16 * 1024;
58 -const MAX_THEME_TOTAL_BYTES = 6 * MAX_THEME_FILE_BYTES;
58 +// Clients cache every published theme in localStorage, which holds about 5 MB per origin.
59 +const MAX_THEME_TOTAL_BYTES = 2 * 1024 * 1024;
60
61 /** A theme's background is `<id>.<extension>` beside `<id>.json`; earlier extensions win. */
62 const THEME_BACKGROUND_EXTENSIONS = ["webp", "png", "jpg", "jpeg"] as const;
apps/server/src/provider/agentContextBudget.json
+1 -1
@@ -1,5 +1,5 @@
1 {
2 "claudeSystemAppendBytes": 5930,
3 "codexAdditionalContextBytes": 7324,
4 - "mcpToolListJsonBytes": 49736
4 + "mcpToolListJsonBytes": 49737
5 }
packages/contracts/src/server.ts
+1 -1
@@ -627,7 +627,7 @@ const EnvironmentThemeColors = Schema.Record(
627 TrimmedNonEmptyString.check(Schema.isMaxLength(64)),
628 );
629
630 -export const THEME_CSS_MAX_LENGTH = 50_000;
630 +export const THEME_CSS_MAX_LENGTH = 100_000;
631
632 const environmentThemeFields = {
633 version: Schema.optional(Schema.Literal(1)),
packages/shared/src/themeCss.ts
+1 -1
@@ -79,7 +79,7 @@ export const THEME_GUIDE = [
79 "",
80 "CSS: `css` applies after the app's styles. Use `.dark` or `:root:not(.dark)` for one appearance.",
81 "It cannot load files: no @import, no image-set(), and url() only with data: or #id.",
82 - 'For a background image, copy a JPEG, PNG, or WebP file of up to 16 MB to `<themesDir>/<themeId>.jpg` (or .png, .webp), beside the theme file. CSS shows it with `var(--theme-background-image)`, such as `[data-workspace-area="conversation"] { background: var(--theme-background-image) center / cover no-repeat; }`. Delete the file to remove it. Do not embed images in `css`: it holds 50,000 characters.',
82 + 'For a background image, copy a JPEG, PNG, or WebP file of up to 16 MB to `<themesDir>/<themeId>.jpg` (or .png, .webp), beside the theme file. CSS shows it with `var(--theme-background-image)`, such as `[data-workspace-area="conversation"] { background: var(--theme-background-image) center / cover no-repeat; }`. Delete the file to remove it. Do not embed images in `css`: it holds 100,000 characters.',
83 "The app's own rules can be more specific. If a rule has no effect, add !important.",
84 "It cannot reach the terminal text, the file tree, or diff internals. Use color roles for those.",
85 "Native scrollbars take `::-webkit-scrollbar` and `::-webkit-scrollbar-thumb`.",