Switch between dark, light, and custom themes using CSS custom properties — applied across all dashboard pages including chat.
!Theme Comparison
| Variable | Value | Usage |
|----------|-------|-------|
| --chat-bg | #0d1117 | Background |
--chat-bg
#0d1117
| --chat-text | #e6edf3 | Primary text |
--chat-text
#e6edf3
| --chat-user-bg | #1f6feb | User message bubble |
--chat-user-bg
#1f6feb
| --chat-assistant-bg | #161b22 | Assistant message bubble |
--chat-assistant-bg
#161b22
| --chat-input-bg | #0d1117 | Input area |
--chat-input-bg
| --chat-border | #30363d | Borders |
--chat-border
#30363d
| --chat-accent | #58a6ff | Links and accents |
--chat-accent
#58a6ff
| --chat-code-bg | #161b22 | Code blocks |
--chat-code-bg
| --chat-bg | #ffffff | Background |
#ffffff
| --chat-text | #1f2328 | Primary text |
#1f2328
| --chat-user-bg | #ddf4ff | User message bubble |
#ddf4ff
| --chat-assistant-bg | #f6f8fa | Assistant message bubble |
#f6f8fa
| --chat-input-bg | #ffffff | Input area |
| --chat-border | #d1d9e0 | Borders |
#d1d9e0
| --chat-accent | #0969da | Links and accents |
#0969da
| --chat-code-bg | #f6f8fa | Code blocks |
Register a custom theme from Python:
Or via API:
| Endpoint | Method | Description |
|----------|--------|-------------|
| /api/theme | GET | Get current theme and CSS variables |
/api/theme
| /api/theme | PUT | Set the active theme |
| /api/theme/list | GET | List all available themes |
/api/theme/list
| /api/theme/custom | POST | Register a custom theme |
/api/theme/custom
The theme system injects CSS custom properties into the :root element. All chat and dashboard CSS uses var(--chat-*) references, so switching themes instantly updates the entire UI.
:root
var(--chat-*)
set_theme()
set_custom_css()
register_theme()