How It Works
- You define color tokens in your
styles.cssusing Tailwind v4’s@themeblock DeepSpaceThemeProvider(set up inmain.tsx) reads those tokens from the DOM- It maps them to 50+
--theme-*CSS variables that style the platform’s overlay UI - Your widget uses the Tailwind tokens directly; the platform UI uses the
--theme-*variables
Zero-Config (Recommended)
In most cases, you just define your colors instyles.css and everything works:
| Your CSS token | Maps to |
|---|---|
--color-surface-elevated | Panel/toolbar backgrounds |
--color-surface-overlay | Button/secondary backgrounds |
--color-primary | Accent/interactive elements |
--color-content | Text color |
--color-background | Used for dark/light mode detection |
Explicit Theme
If you need more control, pass a theme config directly to the provider:Theme Config Options
| Property | Required | Description |
|---|---|---|
primaryColor | Yes | Panel/toolbar background |
secondaryColor | Yes | Button/secondary backgrounds |
accentColor | Yes | Interactive elements, highlights |
textColor | Yes | Primary text color |
panelColor | No | Override panel background |
accentContrastColor | No | Text on accent (default: #ffffff) |
borderColor | No | Defaults to secondaryColor |
backgroundColor | No | Page background (for dark/light detection) |
shadowColor | No | Default: #000000 |
highlightColor | No | Glass effects (default: #ffffff) |
glassmorphism | No | Enable blur effects (default: true) |
Generated Variables
The theme system generates variables across several namespaces:--theme-* — Core platform UI:
--theme-panel-bg,--theme-panel-border--theme-button-bg,--theme-button-hover,--theme-button-active--theme-text,--theme-text-secondary,--theme-text-tertiary--theme-accent,--theme-accent-hover--theme-shadow-primary,--theme-component-shadow
--chat-* — Chat panel:
--chat-panel-bg,--chat-button-bg,--chat-accent--chat-panel-gradient
--ui-* — Modals and overlays:
--ui-bg-primary,--ui-bg-secondary--ui-text-primary,--ui-accent--ui-active-bg
Dark/Light Mode
The theme system automatically detects whether your widget is dark or light by calculating the luminance ofbackgroundColor. This affects:
- Default shadow intensity
- Glass effect highlight colors
- UI overlay contrast