Skip to content

Commit d87e86b

Browse files
tylerslatonclaude
andcommitted
feat(showcase/google-adk/chat-customization-css): port frontend from langgraph-python
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 810d620 commit d87e86b

3 files changed

Lines changed: 687 additions & 78 deletions

File tree

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Chat Customization (CSS)
2+
3+
## What This Demo Shows
4+
5+
How far you can push `CopilotChat` with CSS alone — no slot overrides, no
6+
component swaps, no React. The default look is rounded, system-sans, and
7+
minimal-light. This demo replaces it with **HALCYON**, a warm-paper
8+
editorial brand: cream parchment surface, sharp 90° corners, copper-ember
9+
accents, an italic display serif for big headings, a Fraunces serif voice
10+
for the assistant, and JetBrains Mono dispatch lines for the user.
11+
12+
The point: a team can take CopilotChat off the shelf and skin it to match
13+
their own brand without ever opening a component file.
14+
15+
## How it works
16+
17+
Two layers do the work:
18+
19+
1. **v2 token overrides on `[data-copilotkit]`**`--background`,
20+
`--foreground`, `--primary`, `--muted`, `--border`, `--ring`, `--radius`,
21+
etc. Recolors every Tailwind utility (`cpk:bg-muted`,
22+
`cpk:text-foreground`, …) the runtime renders.
23+
2. **Class-targeted styling**`.copilotKitChat`, `.copilotKitMessages`,
24+
`.copilotKitMessage.copilotKitUserMessage`,
25+
`.copilotKitMessage.copilotKitAssistantMessage`, `.copilotKitInput`, the
26+
welcome screen, suggestions, scrollbar.
27+
28+
Every selector is namespaced under `.chat-css-demo-scope`, so the theme
29+
cannot leak into the rest of the showcase.
30+
31+
## How to Interact
32+
33+
Type any prompt and watch the conversation render in the HALCYON voice:
34+
35+
- `"Say hi"`
36+
- `"Write a one-paragraph product memo about quarterly OKRs"`
37+
- `"Show me a Python snippet for retry with exponential backoff"`
38+
- `"Quote a famous business strategist on focus"`
39+
40+
You'll see:
41+
42+
- The user line render as a mono CLI dispatch with an ember `` marker
43+
- The assistant respond in serif body type with editorial spacing, an
44+
ember left rule, and a dark code-card for code blocks
45+
- The composer pill flatten to a sharp card with an ember focus ring and
46+
a square copper send button
47+
48+
## Aesthetic Notes
49+
50+
- **Surface** — warm parchment (`#F4EFE6`) with a single ambient ember glow
51+
in the top-left and a barely-perceptible paper-grain noise via inline
52+
SVG
53+
- **Masthead** — a centered mono label pinned just under the top edge of
54+
the chat surface (`CopilotChat · Customized with CSS`)
55+
- **Typography** — Instrument Serif (display, italic), Fraunces (assistant
56+
body), Inter Tight (UI), JetBrains Mono (user dispatch + metadata +
57+
suggestions)
58+
- **Accent** — deep copper ember (`#C44A1F`), used only on the user prompt
59+
marker, the assistant left rule, the send button, and focus rings —
60+
sparingly, so it actually reads as signal
61+
- **Geometry** — sharp 90° corners everywhere (radius is overridden to
62+
`0px`), opposite of the default rounded pills
63+
64+
## Technical Details
65+
66+
- `<CopilotKit>` wires `runtimeUrl="/api/copilotkit"` and
67+
`agent="chat-customization-css"` (backed by the shared simple chat
68+
agent in `src/agents/shared_chat.py`)
69+
- `<CopilotChat>` is wrapped in `<div className="chat-css-demo-scope">`;
70+
the theme is applied by `import "./theme.css"` at the top of the page
71+
- `theme.css` first overrides the v2 token variables on `[data-copilotkit]`
72+
(so Tailwind utilities recolor automatically), then layers
73+
class-targeted rules on top for the editorial details that CSS
74+
variables alone can't express
75+
- Fonts load from Google Fonts via `@import` at the top of `theme.css`
76+
so the demo is self-contained — copy the file into another project and
77+
the theme works end-to-end
78+
- Reach for slots (see `chat-slots`) when you need to change _what_ a
79+
piece renders, not just how it looks; reach for CSS — like this demo —
80+
when the default structure is fine and you only need a different
81+
visual identity

showcase/integrations/google-adk/src/app/demos/chat-customization-css/page.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
"use client";
22

3-
// Chat Customization (CSS) — all theming lives in theme.css, scoped to the
4-
// `.chat-css-demo-scope` wrapper. The page stays intentionally minimal;
5-
// only <CopilotChat /> is visibly re-themed.
3+
// Chat Customization (CSS) — every visual choice in this demo lives in
4+
// theme.css and is scoped to the `.chat-css-demo-scope` wrapper. The page
5+
// intentionally stays minimal so the contrast against the default look
6+
// comes entirely from the stylesheet.
67
//
78
// https://docs.copilotkit.ai/custom-look-and-feel/customize-built-in-ui-components
89

@@ -14,12 +15,13 @@ import "./theme.css";
1415

1516
export default function ChatCustomizationCssDemo() {
1617
return (
17-
<CopilotKit runtimeUrl="/api/copilotkit" agent="chat_customization_css">
18-
<div className="flex justify-center items-center h-screen w-full">
18+
<CopilotKit runtimeUrl="/api/copilotkit" agent="chat-customization-css">
19+
<div className="flex justify-center items-center h-screen w-full bg-white p-6">
1920
<div className="chat-css-demo-scope h-full w-full max-w-4xl">
2021
<CopilotChat
21-
agentId="chat_customization_css"
22-
className="h-full rounded-2xl"
22+
agentId="chat-customization-css"
23+
className="h-full"
24+
attachments={{ enabled: true }}
2325
/>
2426
</div>
2527
</div>

0 commit comments

Comments
 (0)