#1068·vanna

CSS custom properties (--chat-primary) not overriding user message bubble color

Author: chmryanCreated Jan 5, 2026Updated Jan 28, 2026

Description

The <vanna-chat> web component's user message bubble color cannot be customized via CSS custom properties despite documentation indicating this should work.

What I'm Trying to Do

Change the user message bubble gradient from the default teal (#15a8a8) to a custom blue (#3877c6).

What I've Tried

1. CSS custom properties in <style> block

css
vanna-chat {
    --chat-primary: #3877c6;
    --chat-primary-stronger: #2d5fa3;
    --chat-primary-foreground: #ffffff;
    --chat-muted: #f8fafc;
    --chat-surface: #ffffff;
}

Result: No effect - user messages still teal.

2. Inline style attribute (higher specificity)

xml
<vanna-chat
    title="My Assistant"
    api-base=""
    style="--chat-primary: #3877c6; --chat-primary-stronger: #2d5fa3; --chat-primary-foreground: #ffffff;">
</vanna-chat>

Result: No effect - user messages still teal.

3. Also tried --vanna-* properties

css
vanna-chat {
    --vanna-teal: #3877c6;
    --vanna-accent-primary-default: #3877c6;
}

Result: No effect.

Expected Behavior

Per the DeepWiki documentation, the component should accept --chat-primary and --chat-primary-stronger to customize the user message bubble color:

"To change the user message bubble gradient color, which uses --chat-primary and --chat-primary-stronger, you would set the --chat-primary and --chat-primary-stronger variables on the <vanna-chat> element directly"

Actual Behavior

The user message bubble remains teal regardless of CSS custom property values set on the element.

Environment

  • Vanna version: 2.0 (latest from pip)
  • Component source: https://img.vanna.ai/vanna-components.js
  • Browser: Chrome (latest)
  • Server: VannaFastAPIServer

Screenshots

The user message bubble (right-aligned) shows teal gradient instead of custom color:

Image

Questions

  1. Are CSS custom properties actually supported for theming the chat component?
  2. If so, what is the correct approach to override --chat-primary?
  3. Is there a different mechanism for customizing colors (e.g., theme attribute, config option)?

Related Code

Looking at frontends/webcomponent/src/components/vanna-chat.ts, it appears the component uses Shadow DOM and imports vannaDesignTokens. The tokens may be applied with higher specificity than external CSS custom properties.