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
Copy file name to clipboardExpand all lines: apps/website/content/docs/chat/guides/theming.mdx
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,6 +97,35 @@ Import `@threadplane/chat/chat.css` in your global styles to get a `:root`-level
97
97
}
98
98
```
99
99
100
+
### Bridge from your design system
101
+
102
+
If your app already has design-system tokens, keep those tokens as the source of truth and map them into the chat public API. This gives your app a stable `--tplane-chat-*` control surface without coupling chat internals to your design-system namespace.
103
+
104
+
```css
105
+
:root {
106
+
/* App-owned design tokens */
107
+
--ds-canvas: #ffffff;
108
+
--ds-surface: #f8fafc;
109
+
--ds-border: #e2e8f0;
110
+
--ds-text-primary: #0f172a;
111
+
--ds-text-muted: #64748b;
112
+
--ds-accent: #2563eb;
113
+
--ds-font-sans: Inter, system-ui, sans-serif;
114
+
115
+
/* Chat-owned public API */
116
+
--tplane-chat-bg: var(--ds-canvas);
117
+
--tplane-chat-surface: var(--ds-surface);
118
+
--tplane-chat-surface-alt: var(--ds-surface);
119
+
--tplane-chat-separator: var(--ds-border);
120
+
--tplane-chat-text: var(--ds-text-primary);
121
+
--tplane-chat-text-muted: var(--ds-text-muted);
122
+
--tplane-chat-primary: var(--ds-accent);
123
+
--tplane-chat-font-family: var(--ds-font-sans);
124
+
}
125
+
```
126
+
127
+
Use the `--tplane-chat-*` names at chat boundaries and custom chat-adjacent views. Use your app tokens everywhere else. The bridge is useful because chat token names describe component semantics (`primary`, `surface-alt`, `separator`, `radius-bubble`) while your design-system tokens can stay product-wide and evolve independently.
Copy file name to clipboardExpand all lines: libs/chat/README.md
+35Lines changed: 35 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -231,6 +231,41 @@ Without `katex` installed, or without the stylesheet, math degrades gracefully
231
231
232
232
### Theming
233
233
234
+
Chat compositions and primitives expose a `--tplane-chat-*` CSS variable API for colors, typography, spacing, radii, and z-index layers. Override those variables on `:root`, on the `<chat>` host, or on any ancestor:
235
+
236
+
```css
237
+
:root {
238
+
--tplane-chat-primary: #2563eb;
239
+
--tplane-chat-on-primary: #ffffff;
240
+
--tplane-chat-radius-bubble: 12px;
241
+
}
242
+
```
243
+
244
+
If your app already has design-system tokens, keep them as the source of truth and bridge them into the chat API:
245
+
246
+
```css
247
+
:root {
248
+
--ds-canvas: #ffffff;
249
+
--ds-surface: #f8fafc;
250
+
--ds-border: #e2e8f0;
251
+
--ds-text-primary: #0f172a;
252
+
--ds-text-muted: #64748b;
253
+
--ds-accent: #2563eb;
254
+
--ds-font-sans: Inter, system-ui, sans-serif;
255
+
256
+
--tplane-chat-bg: var(--ds-canvas);
257
+
--tplane-chat-surface: var(--ds-surface);
258
+
--tplane-chat-surface-alt: var(--ds-surface);
259
+
--tplane-chat-separator: var(--ds-border);
260
+
--tplane-chat-text: var(--ds-text-primary);
261
+
--tplane-chat-text-muted: var(--ds-text-muted);
262
+
--tplane-chat-primary: var(--ds-accent);
263
+
--tplane-chat-font-family: var(--ds-font-sans);
264
+
}
265
+
```
266
+
267
+
Use app tokens for app layout and `--tplane-chat-*` tokens at chat boundaries or custom chat-adjacent views. That keeps chat's public theming surface stable even if your app design-system token names change.
268
+
234
269
`<a2ui-surface>` declares ~50 `--a2ui-*` CSS custom properties at `:host` with dark-theme defaults covering color, spacing, typography, shape radius, focus ring, motion, and elevation. Catalog components consume them via `var(--a2ui-*)`.
235
270
236
271
**Built-in presets** — import one in your global stylesheet:
0 commit comments