Match Your Brand
Brand the Support widget with CSS variables, the theme prop, and your app tokens.
You can make the widget feel like part of your product without replacing any components.
Use this when
- the default widget shape is good and you mainly need branding
- you want a copy-paste way to set colors and radius
- you want the widget to follow your app theme or force dark mode
Pick the simplest path
In many Tailwind + shadcn apps, the widget already feels native after you import the CSS entrypoint. Start with the smallest option that matches what you need.
Best default
Do nothing
If your app already exposes shadcn-style tokens, import the widget CSS and render <Support />.
Setup
No extra theme CSSThe widget picks up host colors, radius, fonts, and dark mode automatically.
Pinned brand
Set --co-theme-*
Use explicit widget tokens when the widget should keep the same branded values across apps.
Setup
.cossistant { --co-theme-primary: ... }Widget overrides win over host tokens without changing the rest of the app.
Forced mode
Use theme="dark"
Use the theme prop when the widget should stay dark instead of following the page theme.
Setup
<Support theme="dark" />Color mode is pinned while the rest of the theming contract stays the same.
Theme precedence
The widget resolves theme values in this order:
- Explicit
--co-theme-*overrides you set on.cossistant - Host shadcn-style tokens like
--background,--primary,--radius, and--font-sans - Built-in Cossistant defaults
That means the widget will already feel closer to your app in many setups before you write any extra theme CSS.
Theme Order
How the widget picks its background color
First defined value wins. The same order applies to the other supported widget tokens too.
Widget override
Set this on .cossistant when you want the widget to use a pinned value.
--co-theme-background ->Host app token
If the widget override is missing, the widget uses your app token instead.
--background ->Cossistant default
When neither token is defined, the widget falls back to the shipped default.
oklch(99% 0 0)Result: widget overrides win first, then host shadcn-style tokens, then Cossistant defaults. The same pattern applies to colors, radius, fonts, and dark mode-aware tokens.
Do nothing in many shadcn apps
If your app already exposes the usual shadcn-style tokens on :root and .dark, the widget picks them up automatically. No extra theme mapping is needed to start.
Render <Support />, import either support.css or styles.css, and see how far the automatic host theme gets you before you add overrides.
What gets inherited automatically
The default widget looks for these host tokens today:
--background--foreground--popover--popover-foreground--primary--primary-foreground--secondary--secondary-foreground--muted--muted-foreground--accent--accent-foreground--border--input--ring--destructive--destructive-foreground--radius--font-sans--font-mono
Dark mode follows your app automatically too. The widget checks for .dark on an ancestor or data-color-scheme="dark" on the widget root.
This automatic adoption is intentionally scoped to standard shadcn-style base tokens:
- colors
- radius
- fonts
- dark mode
Pin widget values
Set the widget tokens once and keep the default UI.
.cossistant {
--co-theme-primary: #111827;
--co-theme-primary-foreground: #ffffff;
--co-theme-background: #ffffff;
--co-theme-foreground: #111827;
--co-theme-border: #e5e7eb;
--co-theme-radius: 0px;
}That is usually enough when you want to pin the widget to your own values instead of relying on the host tokens.
Force dark mode
import { Support } from "@cossistant/react";
<Support theme="dark" />;By default, the widget follows your app theme. Use theme="dark" when the widget should stay dark instead of following the page theme.
Pin the widget to your shadcn tokens
This is still useful when you want the widget theme to stay explicitly linked to your app tokens, even if you later rename or swap the host token source.
:root {
--co-theme-background: var(--background);
--co-theme-foreground: var(--foreground);
--co-theme-primary: var(--primary);
--co-theme-primary-foreground: var(--primary-foreground);
--co-theme-border: var(--border);
--co-theme-radius: var(--radius);
}What is not inherited automatically
The widget inherits CSS design tokens, radius, fonts, and dark mode. It does not inherit arbitrary compile-time Tailwind config such as:
- custom spacing scales
- custom shadow scales
- custom plugin utilities
- unrelated utility renames or variants
If your app uses custom token names outside the standard shadcn-style base tokens, map them explicitly into --co-theme-*.
When to stop here
- colors, radius, and dark mode are enough
- you want the default layout to stay in place
- you do not need custom pages or a custom shell
Next step
- Pages & Layouts when you need a different first screen, an inline embed, or your own shell
- Copy & Locale when the next change is wording instead of UI
Core token reference
| Variable | Light preview | Default (Light) | Dark preview | Default (Dark) |
|---|---|---|---|---|
--co-theme-background | oklch(99% 0 0) | oklch(15.5% 0 0) | ||
--co-theme-foreground | oklch(20.5% 0 0) | oklch(95% 0 0) | ||
--co-theme-primary | oklch(14.5% 0 0) | oklch(98.5% 0 0) | ||
--co-theme-primary-foreground | oklch(98.5% 0 0) | oklch(14.5% 0 0) | ||
--co-theme-border | oklch(92.2% 0 0) | oklch(26.9% 0 0) | ||
--co-theme-muted | Color-mixed | Color-mixed | ||
--co-theme-muted-foreground | Color-mixed | Color-mixed | ||
--co-theme-radius | - | 0.375rem | - | 0.375rem |
Extra tokens
Use these when the core tokens are not enough:
Status colors
| Variable | Light preview | Default (Light) | Dark preview | Default (Dark) |
|---|---|---|---|---|
--co-theme-destructive | oklch(57.7% 0.245 27.325) | oklch(39.6% 0.141 25.723) | ||
--co-theme-success | oklch(71.7% 0.18 142) | oklch(60% 0.15 142) | ||
--co-theme-warning | oklch(86.4% 0.144 99) | oklch(90.3% 0.111 99) | ||
--co-theme-neutral | oklch(60.8% 0 0) | oklch(50% 0 0) |
Avatar accents
| Variable | Light preview | Default (Light) | Dark preview | Default (Dark) |
|---|---|---|---|---|
--co-theme-pink | oklch(76.3% 0.152 354) | oklch(84.2% 0.109 354) | ||
--co-theme-yellow | oklch(86.4% 0.144 99) | oklch(90.3% 0.111 99) | ||
--co-theme-blue | oklch(72.5% 0.132 241) | oklch(79.8% 0.089 241) | ||
--co-theme-orange | oklch(74.5% 0.166 50) | oklch(68.2% 0.194 50) |
Background shades
| Variable | Light preview | Default (Light) | Dark preview | Default (Dark) |
|---|---|---|---|---|
--co-theme-background-50 | Color-mixed | Color-mixed | ||
--co-theme-background-100 | Color-mixed | Color-mixed | ||
--co-theme-background-200 | Color-mixed | Color-mixed | ||
--co-theme-background-300 | Color-mixed | Color-mixed |
The background shades are derived from your base colors with color-mix() unless you override them directly.
On this page
Use this whenPick the simplest pathTheme precedenceDo nothing in many shadcn appsWhat gets inherited automaticallyPin widget valuesForce dark modePin the widget to your shadcn tokensWhat is not inherited automaticallyWhen to stop hereNext stepCore token referenceExtra tokensStatus colorsAvatar accentsBackground shades