> ## Documentation Index
> Fetch the complete documentation index at: https://docs.remark.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Theme tokens

> Adjust widget sizing, typography, spacing, and colors with CSS custom properties.

[Writing custom CSS](https://docs.remark.ai/sdk/styling/custom-css.md) · [Activator parts](https://docs.remark.ai/sdk/styling/parts/activators.md) · [Chat shell parts](https://docs.remark.ai/sdk/styling/parts/chat.md) · [Message and content parts](https://docs.remark.ai/sdk/styling/parts/messages.md) · [Overlay parts](https://docs.remark.ai/sdk/styling/parts/overlays.md)

## CSS Custom Properties

The chat widget's theme system generates CSS custom properties that you can reference in custom CSS rules. These properties are grouped into sizing tokens (which can be overridden directly) and color tokens (which are generated from widget settings).

### Sizing and Typography

These properties correspond to dashboard settings but can also be overridden in custom CSS when finer control is needed. They are set on the Remark element itself, so override them on `[data-remark]` or a specific element such as `remark-qa-activator`.

| Variable | Default | Controls | Dashboard Setting |
| - | - | - | - |
| `--hem` | `16px` | Base font size unit — all typography scales as a ratio of this value | Font size |
| `--remark-spacing-multiplier` | `1` | Unitless multiplier for all spacing tokens | Padding |
| `--remark-radii-base` | `0.5rem` | Base border radius | Border roundness |
| `--remark-fonts-sans` | System font stack | Font family for all text | Font family |

`--hem` stands for "host em" — it serves the same role as [`rem`](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/font-size#rems) but is scoped to the widget's shadow DOM root rather than the page's `<html>` element. This means the widget's typography scales independently of the host page's font size. Typography tokens use `--hem` as their base unit. Adjust the dashboard font size or override `--hem` to scale the widget, and use the emitted `--remark-font-sizes-*` variables for individual sizes.

> [!TIP]
>
> `--hem` is already responsive to the host page's root font size. If your site already adjusts `font-size` on `<html>` for different viewports, the widget may scale along with it automatically depending on your configuration.

### Distance from the Screen Edge

The floating chat and its activator sit a fixed distance from the viewport edge, controlled by two custom properties. Both default to `24px` and are independent of `--remark-spacing-multiplier`, which scales spacing *inside* the widget.

| Variable | Default | Controls |
| - | - | - |
| `--remark-spacing-bottom-distance` | `24px` | Distance from the bottom edge |
| `--remark-spacing-side-distance` | `24px` | Distance from the left or right edge |

Set them on `remark-chat-widget` to move the activator and the open chat panel together. To move only one, scope the override to its part — `::part(activator-parent)` for the activator, `::part(app-parent)` for the open chat panel:

```css theme={null}
/* Raise the activator and open chat to clear a sticky footer bar */
remark-chat-widget {
  --remark-spacing-bottom-distance: 96px;
}

/* Move only the activator, leaving the open chat where it is */
remark-chat-widget::part(activator-parent) {
  --remark-spacing-bottom-distance: 96px;
}
```

This applies to the floating chat only; the embedded chat follows normal page flow. On mobile, the open chat panel fills the screen and ignores the bottom distance, but the activator still respects it. At the full height size, the open panel docks to the screen edge on larger screens and ignores both distances.

### Button Activator Size and Shape

These custom properties set the size and shape of the floating button activator and its unread count badge.

| Variable | Default | Controls |
| - | - | - |
| `--remark-sizes-activator-button` | `48px` | Diameter of the button activator |
| `--remark-radii-activator-button` | `var(--remark-radii-full)` | Corner radius of the button activator. The default makes it a circle |
| `--remark-sizes-badge` | `20px` | Height and minimum width of unread count badges. A badge widens to fit a longer count |

Both sizes scale with `--hem`, so the defaults are 48px and 20px at the default font size. Set the variables on `remark-chat-widget`, or on `::part(activator-parent)` to change only the activator. The count badge sits on the button's rounded corner and follows it to any size or radius:

```css theme={null}
/* Larger rounded-square button activator */
remark-chat-widget::part(activator-parent) {
  --remark-sizes-activator-button: 56px;
  --remark-radii-activator-button: 16px;
}
```

> [!NOTE]
>
> The badge takes its position from the variables on `activator-parent`. A `border-radius`, size, or variable set directly on `::part(activator-button)` reshapes the button without moving the badge.

### Colors

Color tokens are generated from the brand color and palette overrides configured in the dashboard. They follow the naming pattern `--remark-colors-{name}` and have separate light and dark mode values.

These tokens are set on the Remark element. You can reference them in `::part()` rules, but to change colors, use the dashboard palette settings rather than overriding variables directly.

The element carries the active color scheme as `data-color-scheme`, either `light` or `dark`. Add it to the element selector to style one scheme only:

```css theme={null}
/* Dark mode only: give suggested questions a stronger border */
[data-remark][data-color-scheme='dark']::part(prompt-button) {
  border-color: var(--remark-colors-border-emphasis);
}
```

#### Content

| Variable | Purpose |
| - | - |
| `--remark-colors-content-default` | Primary text |
| `--remark-colors-content-secondary` | Secondary text |
| `--remark-colors-content-muted` | De-emphasized text |
| `--remark-colors-content-action` | Brand-tinted text meeting contrast requirements |

#### Backgrounds

| Variable | Purpose |
| - | - |
| `--remark-colors-background-default` | Primary background |
| `--remark-colors-background-hover` | Background on hover |
| `--remark-colors-background-secondary` | Secondary background (e.g., alternate message rows) |

#### Borders

| Variable | Purpose |
| - | - |
| `--remark-colors-border-default` | Default border |
| `--remark-colors-border-subtle` | Subtle or secondary border |
| `--remark-colors-border-active` | Active or focused border |
| `--remark-colors-border-emphasis` | Emphasized border |

#### Brand

| Variable | Purpose |
| - | - |
| `--remark-colors-brand-fill` | Brand color fill |
| `--remark-colors-brand-on-fill` | Text on brand fill |
| `--remark-colors-brand-subdued` | Subdued brand tint |
| `--remark-colors-brand-content` | Brand color for text |
| `--remark-colors-brand-border` | Brand color for borders |

#### Action

These correspond to the **Button color** override in the dashboard.

| Variable | Purpose |
| - | - |
| `--remark-colors-action-fill` | Interactive element fill (send button, floating activator) |
| `--remark-colors-action-on-fill` | Text on action fill |
| `--remark-colors-action-hover` | Interactive element fill on hover |

#### Status

| Variable | Purpose |
| - | - |
| `--remark-colors-online-fill` | Online indicator |
| `--remark-colors-online-on-fill` | Text on online indicator |
| `--remark-colors-online-content` | Online color for text |
| `--remark-colors-online-border` | Online color for borders |
| `--remark-colors-critical-fill` | Error or critical fill |
| `--remark-colors-critical-on-fill` | Text on critical fill |
| `--remark-colors-critical-content` | Critical color for text |
| `--remark-colors-critical-border` | Critical color for borders |

#### Elevated Surfaces

| Variable | Purpose |
| - | - |
| `--remark-colors-elevated-fill` | Elevated surface (cards, dropdowns) |
| `--remark-colors-elevated-hover` | Elevated surface on hover |
| `--remark-colors-elevated-on-fill` | Text on elevated surfaces |

#### Overlays and Inverse

| Variable | Purpose |
| - | - |
| `--remark-colors-overlay-fill` | Semi-transparent overlay |
| `--remark-colors-overlay-emphasis-fill` | Strong overlay |
| `--remark-colors-inverse-background` | Inverted background |
| `--remark-colors-inverse-content` | Inverted text |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.