You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Theme CSS is capped at 20,000 characters, too small for a full restyle #36650
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
packages/contracts or packages/shared
Steps to reproduce
Build a theme whose custom CSS restyles most of the app (surfaces, menus, inputs, buttons, cards, icons, git colors, font weight).
Publish it through any of the three paths: the theme editor's Custom CSS section, the t3_theme_set agent tool, or a theme file in the themes folder.
Expected behavior
A theme that restyles the whole app fits. Theme CSS from #35247 is built for exactly this, and agents are encouraged to write it.
Actual behavior
The CSS is capped at 20,000 characters (THEME_CSS_MAX_LENGTH in packages/contracts/src/server.ts). Past that, the theme editor refuses it with "Theme CSS must be text of 20000 characters or fewer.", t3_theme_set rejects the input, and the server skips a theme file over 32 KB. A real full restyle already needs about 15,500 characters with every comment and space stripped, so there is little room left, and embedded icons or images use it up quickly.
This limit also affects image-backed themes: embedded background images share the 20,000-character budget with CSS, so even a lightly styled theme can require severe image compression.
Please consider increasing the CSS and theme-file limits together, and supporting separately stored, app-managed theme assets with their own size budget. That would give custom themes more room without forcing image quality to depend on the remaining CSS budget.
Activity
pantharshit007 commentedon Nov 14, 2026
This limit also affects image-backed themes: embedded background images share the 20,000-character budget with CSS, so even a lightly styled theme can require severe image compression.
Please consider increasing the CSS and theme-file limits together, and supporting separately stored, app-managed theme assets with their own size budget. That would give custom themes more room without forcing image quality to depend on the remaining CSS budget.