Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

8.2 KB
Raw Blame

Colours outside the theme

Every colour in client/src and packages/client/src comes from a semantic theme role, except the entries below. Each entry is one kind of colour that must not follow the theme, with the files that hold it and why the theme does not own it. Scrims, chips and progress drawn over the user's own media are not exceptions: they read surface-media-overlay and text-on-media, which every bundled theme keeps black and white. The drop zone's artwork reads the illustration roles, file-type tiles the file-* roles, the default avatar's hairline avatar-edge, and a dragged badge's lift elevationDrag.

A literal the design lint can see is covered either by a per-file shadcn/no-raw-colors allow block in eslint.config.mjs (the brand and decorative marks named below) or by a count in eslint-suppressions.json (inline disables of the design rules are rejected by the static checks), so the count there is the exception, not debt. Everything else is invisible to the lint (strings passed to a canvas or an iframe), so this list is the record. Stylesheets are the exception: scripts/css-colors.mts fails npm run static-checks on a colour literal, or a bare channel triplet in a custom property, in any .css under client/src or packages/client/src, except in the custom properties of defaults.css and tokens.css (entry 1), the .azure-bg-color rule in client/src/mobile.css (entry 2) and the select rule in client/src/style.css (entry 9).

Adding an entry needs the same bar: if a theme author would reasonably want to recolour it, it is a role, not an exception. Keep the list to ten entries or fewer; a new kind of exception that does not fit an entry below is a sign it should be a role.

# Entry Files Why
1 Theme definitions packages/client/src/theme/themes/*.ts, themes/clickui.json, packages/data-provider/src/themes/*.ts, packages/client/src/theme/defaults.css, packages/client/src/theme/tokens.css The palettes and appearance values themselves: these are the values roles resolve to.
2 Third-party brand marks packages/client/src/svgs/GoogleIcon.tsx, FacebookIcon.tsx, DiscordIcon.tsx, GeminiIcon.tsx, PaLMIcon.tsx; client/src/mobile.css (.azure-bg-color); client/src/components/Chat/Input/Files/SourceIcon.tsx (the OpenAI chip) Fixed by each company's brand guidelines: the Google, Facebook, Discord, Gemini and PaLM marks, the Azure file-source chip's blue gradient, and the OpenAI file-source chip (white/75, black/65 in dark) behind OpenAI's mark.
3 Provider brand colours packages/client/src/icons/provider/registry.ts, icons/provider/Avatar.tsx Each provider colour is already behind a --provider-* variable a deployment can override; the literal is only its fallback.
4 Opt-in decorative palettes packages/client/src/svgs/BirthdayIcon.tsx, packages/client/src/components/PixelCard.tsx, client/src/components/Lia/engine/*.ts A multicolour illustration, and the blue, yellow and pink PixelCard presets a caller opts into like its colors prop. The app renders only PixelCard's default, which reads theme roles. The Lia mascot's sprite palette is artwork, not UI chrome.
5 Documents that leave the app client/src/utils/markdown.ts, client/src/utils/richtext.ts The downloaded HTML document's GitHub Primer stylesheet, and inline styles on HTML copied to the clipboard; both are read outside the app, where no theme variables exist and the sender's theme must not travel. The markdown high-contrast branch reads the roles.
6 Sandboxed iframe documents client/src/utils/mermaid.ts, client/src/utils/artifacts.ts The mermaid document and its zoom controls, and the artifact document's scrollbar thumb, render in their own iframe without theme variables; the token reads' fallbacks and the luminance repair ink are literals by necessity.
7 Third-party surfaces client/src/hooks/Files/useSharePointPicker.ts, client/src/components/Artifacts/ArtifactCodeEditor.tsx Background of Microsoft's SharePoint file picker iframe, matched to that third party's own surface, and the canvas of Monaco's built-in vs-dark editor theme, painted behind the editor while it loads so the Code tab does not flash; Monaco owns that colour, and the high-contrast editor themes already read the roles.
8 Fallbacks for a role read at runtime client/src/utils/officePreview.ts, client/src/hooks/ScreenshotContext.tsx Used only when the role's variable is unset; the value painted otherwise is the role, read with readThemeColor or from the bundled palette.
9 Inline image in a base rule client/src/style.css (the select rule) The select arrow is an inline SVG data image, which cannot read a theme variable; its stroke is a fixed neutral gray. The rule's own colours read the --select-* roles.