Colours
Brand colour
The brand colour paints the accents: the launcher, the send button, links and focus rings. Text on it is set to black or white, whichever reads better.| Attribute | Description | Default |
|---|---|---|
data-brand-color | Your brand colour, such as #6306B6 | #343CED |
data-brand-color-dark | The brand colour in dark mode | The light one |
Colour palette
The palette sets surfaces, text and borders, separately from the brand colour.| Attribute | What it paints | Light default | Dark default |
|---|---|---|---|
data-surface-color | Panel background | #ffffff | #17171a |
data-surface-elevated-color | Cards, the question box, code blocks | #f8fafc | #212124 |
data-surface-hover-color | Hover states | #f1f5f9 | #2a2a2e |
data-text-color | Body text | #0f172a | #e4e4e7 |
data-text-secondary-color | Secondary text | #64748b | #a1a1a9 |
data-text-muted-color | The faintest text. Also sets secondary text when that is not set | #94a3b8 | #71717a |
data-border-color | Borders and dividers | #e2e8f0 | #3f3f45 |
data-anchor-color | Links inside an answer | Brand colour | Brand colour |
data-overlay-color | The dimmed backdrop behind the panel | rgba(15,23,42,.35) | rgba(0,0,0,.55) |
Colour scheme
| Attribute | Description | Default |
|---|---|---|
data-color-scheme | "light", "dark", or "auto" to follow the reader’s operating system | "light" |
"auto".
Every palette attribute has a dark version: add -dark to the name, such as data-surface-color-dark.
- Palette values apply to one mode.
data-surface-coloris used in light mode only,data-surface-color-darkin dark mode only. A mode you leave unset keeps its default. The light value is never reused in dark mode. - The brand colour and component styles apply to both modes. Their
-darkversion overrides them in dark mode only.
Syncing with your site’s theme
If your site has its own dark-mode switch, point the widget at what that switch sets. The widget follows it on load and every time the reader flips it.| Attribute | Description | Default |
|---|---|---|
data-color-scheme-selector | A CSS selector that matches only while your page is dark. Match: the widget is dark. No match: light. Wins over data-color-scheme | Not set |
<html>, <body> or a wrapper all work. A selector that is not valid counts as “not dark”.
| Site uses | Its switch sets | Selector |
|---|---|---|
| Docusaurus | data-theme="dark" on <html> | [data-theme='dark'] |
| Tailwind, Mintlify | a dark class on <html> | html.dark |
| Bootstrap | data-bs-theme="dark" on <html> | [data-bs-theme='dark'] |
| GitHub-style | data-color-mode="dark" | [data-color-mode='dark'] |
Per-component dark overrides
This header is light grey in light mode and near-black in dark mode:-dark suffix.
Example: a full light and dark theme
Typography and scale
| Attribute | Description | Default |
|---|---|---|
data-font-family | Any CSS font stack | The system font |
data-font-size-xs | Smallest text | 11.5px |
data-font-size-sm | Small text | 13px |
data-font-size-md | Body text | 14px |
data-font-size-lg | Large text | 15px |
data-scale-factor | Multiplies every text size and control size. "1.1" makes the widget 10% larger | 1 |
data-border-radius | Corner rounding of the panel and its cards | 16px |
15px: a bare number does not work here. The widget sizes everything in pixels, so your site’s base font size does not affect it. data-font-size-xl is accepted but changes nothing: no text uses that step.
View modes
data-view-mode changes the whole layout. Other options and component styles still apply on top.
| Value | Layout |
|---|---|
modal (default) | A centred panel, 760px wide and 780px tall. Closes on Esc or a click outside it. The ⤢ header button widens it to data-modal-expanded-size (1500px) |
sidebar | A 460px panel (data-sidebar-width) that slides in from the right and fills the window’s height. The ⤢ button moves it to the centre of the screen |
search | A panel near the top of the page, like a command palette, with no launcher. data-search-input="#your-search-box" attaches it to your own search field. See the search view mode |