Skip to content

🎨 docs: Document the Deployment Theme, Appearance Scales and ClickHouse Theme - #782

Open
berry-13 wants to merge 4 commits into
mainfrom
berry-13/theme-config-docs
Open

berry-13 wants to merge 4 commits into
mainfrom
berry-13/theme-config-docs

Conversation

@berry-13

@berry-13 berry-13 commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Documents the deployment theme on LibreChat canary. A new Theme page under the librechat.yaml object structure covers the bundled names (librechat, clickhouse), the inline definition format, precedence against high contrast, REACT_APP_THEME_* and stored themes, shared-link tenant themes, the 106 color tokens with the focus, pressed, disabled, control border, scrim, switch, table and chart series roles, all 46 appearance properties with their defaults and accepted values (including the type scale, line heights, scrim opacities, switch size, table spacing and disabledStyle), brand tokens, and what the ClickHouse reference theme changes.

It also documents how a theme is validated: the server checks interface.theme when the config loads and on reload, and an invalid theme falls back to the default theme with a warning while the rest of the config loads. An unknown color or appearance token is ignored with a warning naming it, and the rest of the theme applies (LibreChat-AI/LibreChat#16529). The fonts section reflects that Inter, Roboto Mono and Inconsolata are bundled, and a closing section explains the published @librechat/client/theme.css stylesheet and its fonts.

The interface page gains a short theme section that links to it, and the environment variables page documents REACT_APP_THEME_*, which had no docs before.

Change Type

  • Documentation update

Testing

  • Token counts, defaults, accepted values and log messages were checked against packages/data-provider/src/theme.ts, packages/client/src/theme and packages/api/src/app on the LibreChat PR head.
  • pnpm build on Node 24.16.0 succeeds, and the prerendered Theme page contains the new sections and tables.
  • The Theme page compiles with @mdx-js/mdx and remark-gfm, and Prettier reports it clean. ESLint ignores MDX in this repo.

Checklist

  • My changes follow the existing page structure and style
  • I have checked the rendered pages locally

@vercel

vercel Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
librechat-ai Ready Ready Preview Sep 30, 2026 6:00am UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-30T06:12:16.627000Z 0dce7a9 New commits
🔒 Security Review ✅ Completed 2026-09-30T05:49:59.150497Z 1af8f36 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a69b1f34b3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


Sets the deployment theme applied to every user, in both light and dark mode. Either the name of a bundled theme (`librechat` or `clickhouse`) or an inline theme definition with its own colors, radii, fonts, shadows and motion.

It outranks the `REACT_APP_THEME_*` build-time colors and users' stored themes, yields to the high-contrast modes, and is never saved to the user's browser, so removing it restores each user's own theme.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Qualify the fallback after removing interface.theme

When the client was built with any REACT_APP_THEME_* value, removing interface.theme falls back to those build-time colors rather than restoring the user's stored theme. The detailed Theme page correctly includes this condition, so this summary should do the same to avoid giving operators an incorrect rollback expectation.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 82923b8. Checked against canary client/src/Providers/DeploymentTheme.tsx: on withdrawal the stored theme is only read when getThemeFromEnv() returns nothing, so a build with REACT_APP_THEME_* falls back to those colors. The interface summary now says so, matching the Theme page.

3. **`REACT_APP_THEME_*`** build-time colors. See [Theme Colors](/docs/configuration/dotenv#theme-colors).
4. **The user's stored theme** in their browser.

The deployment theme only decides colors and shape. Each user still chooses light, dark or system mode themselves.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include all appearance properties in the theme scope

For an inline theme that sets fontFamily, shadow values, or motion durations, the deployment theme does control more than colors and shape, as the appearance table later on this page documents. Saying it “only decides colors and shape” contradicts those supported settings and may lead operators to think their typography, shadows, or motion configuration is ignored; only the user's light/dark/system mode remains independently selected.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 82923b8. themeAppearanceProperties in canary packages/client/src/theme/registry.ts also covers fontFamily, monoFontFamily, the shadow steps and motionFast/motionNormal. The sentence now reads "sets colors, shape, fonts, shadows and motion, but not the mode"; light/dark/system stays the user's choice.

@github-actions

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Analysis for librechat.ai

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@github-actions

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Analysis for librechat.ai

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@github-actions

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Analysis for librechat.ai

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1af8f36d41

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


The server checks `interface.theme` with the same rules the browser applies before painting it, when `librechat.yaml` is loaded and on every config reload.

**An invalid theme falls back to the default theme.** A wrong `version`, a missing `name`, a mode other than `light` or `dark`, an unknown field, an unknown brand token, or a value of the wrong kind for any token makes the theme unusable. LibreChat removes `interface.theme`, logs a warning with one line per problem, and loads the rest of the configuration as usual, so a theme mistake never stops the server:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Describe invalid themes as falling through the priority chain

When an inline theme is invalid for a user with build-time colors or a stored theme, removing interface.theme makes the client select that lower-priority source, as the precedence and removal behavior above already document; it does not necessarily apply the default LibreChat theme. This claim gives operators the wrong expected result while diagnosing a rejected definition, so describe the same fallback chain used for an unset theme.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0dce7a9. The Validation section now says an invalid theme is dropped as if interface.theme were unset, so users get the next source in the priority chain (REACT_APP_THEME_* colors or their stored theme, else the default), and notes that the server log calls this the default theme. Checked against packages/api/src/app/theme.ts, which deletes interface.theme on error.

| `librechat` | The default LibreChat palette and shape. Setting it explicitly also overrides `REACT_APP_THEME_*` colors and users' stored themes. |
| `clickhouse` | A reference theme built from ClickHouse's Click UI design tokens. See [ClickHouse theme](#clickhouse-theme). |

A name that is not one of these is ignored: the browser console logs `[DeploymentTheme] Ignoring unknown interface.theme "<name>"` and the app falls back to the next source in the list above.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Direct unknown-name diagnostics to the server log

When an operator puts an unknown bundled name in librechat.yaml, the server-side validation described later on this page rejects and removes it before the pre-login configuration reaches the browser, so the browser does not ordinarily emit this console message. Point readers to the server warning instead; the browser warning is only relevant to cases such as the cached-client mismatch described later.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0dce7a9. The bundled-themes paragraph now says the server logs an unknown name and drops interface.theme, pointing to Validation, which quotes the server message (Unknown bundled theme "", expected one of: librechat, clickhouse). The browser warning is kept only for the cached-client case at the end of Validation.

…theme

Add a Theme page under the librechat.yaml object structure covering
bundled theme names, the inline definition format, theme precedence,
shared-link tenant themes, every appearance key with its default, brand
tokens and the ClickHouse reference theme. Add the theme field to the
interface page and document the REACT_APP_THEME_* build-time colors in
the environment variables page.
Removing interface.theme falls back to REACT_APP_THEME_* colors when the client was built with them, not to the stored theme, and the deployment theme also sets fonts, shadows and motion.
@github-actions

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Analysis for librechat.ai

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

This branch was successfully deployed

1 active deployment
Preview — 0dce7a9b Deployed Sep 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant