Skip to content

[Bug]: Theme CSS is capped at 20,000 characters, too small for a full restyle #36650

Closed

Description

@pouyarezvani

Before submitting

  • 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

  1. Build a theme whose custom CSS restyles most of the app (surfaces, menus, inputs, buttons, cards, icons, git colors, font weight).
  2. 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.

Impact

Minor bug or occasional failure

Version or commit

v0.1.10-nightly.20261114.4682 (main at 820f620)

Environment

macOS desktop app (Nightly)

Activity

  1. pantharshit007 commented on Nov 14, 2026

    @pantharshit007

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions