Helpway Docs

Theming & Tokens

Match the widget to your brand with CSS variables. Light + dark mode, brand color, radius, fonts — overridable from your host stylesheet.

The default Helpway widget ships with a clean light + dark theme out of the box, but every visual primitive — surface colors, text contrast, brand accent, border radius — is exposed as a CSS variable on the widget root (.hw-widget). Override one variable in your own stylesheet and every component picks it up.

Quick start

/* in your app's global stylesheet, after Helpway's CSS loads */
.hw-widget {
  --hw-brand: #7c5cff;     /* your accent color */
  --hw-on-brand: #ffffff;  /* foreground that sits on --hw-brand */
  --hw-radius: 14px;       /* corner softness */
}

That's it. Team avatars, primary CTAs, and any future brand-tinted surface adopt the new color immediately.

Dark mode

Three modes — pick one:

ModeHow
Auto (default)Follows the visitor's OS via prefers-color-scheme. No code needed.
Force lightSet data-theme="light" on the widget root, or pass theme="light" as a prop.
Force darkSet data-theme="dark".
<HelpwayWidget apiKey="pk_live_xxx" theme="dark" />

When dark is active, every token below switches to its dark value — including --hw-brand, which inverts so a dark brand color stays visible on dark surfaces.

Token reference

All tokens live on .hw-widget. Override them on the same selector (or its inline style) to retheme.

Surfaces

TokenLightDarkUsed by
--hw-bg#ffffff#1c1c1eWindow background, primary cards
--hw-bg-subtle#fafafa#161618Inputs, deeper surfaces
--hw-bg-hover#f5f5f5#2c2c2eHover states, secondary buttons
--hw-border#f0f0f0rgba(255,255,255,0.08)Subtle dividers
--hw-border-md#e5e5e5rgba(255,255,255,0.14)Stronger dividers

Text

TokenLightDarkUsed by
--hw-text / --hw-text-1#111#f5f5f5Primary copy
--hw-text-2#666#a1a1aaSecondary copy, captions
--hw-text-3#999#71717aPlaceholders, metadata
--hw-text-4#bbb#52525bDisabled, faintest

Brand

TokenLightDarkUsed by
--hw-brand#171717#f5f5f5Team avatar fallback, primary CTAs
--hw-on-brand#ffffff#1c1c1eForeground on --hw-brand (text + svg)
--hw-primary#171717#171717Composer send button bg
--hw-accent#6366f1#6366f1Reserved for future highlight surfaces

Note: --hw-brand and --hw-on-brand come as a pair. If you set a custom --hw-brand, set --hw-on-brand too to guarantee contrast — the default #fff will not work on a light brand.

Bubbles

TokenLightDarkUsed by
--hw-visitor-bubble-bg#f0f0f0#2c2c2eVisitor message bubble background
--hw-visitor-bubble-text#1a1a1a#f5f5f5Visitor message text

Focus & interaction

TokenLightDarkUsed by
--hw-focus-border#9ca3afrgba(255,255,255,0.28)Border on focused inputs
--hw-focus-ringrgba(0,0,0,0.06)rgba(255,255,255,0.08)Halo around focused inputs

Geometry & typography

TokenDefaultUsed by
--hw-radius16pxWindow + cards corner radius
--hw-fontsystem stackWhole widget font family

Runtime tokens (don't override)

These are set programmatically by the widget. Listed for completeness:

  • --hw-position-left / --hw-position-right — launcher anchor
  • --hw-window-left / --hw-window-right — open window anchor
  • --hw-visible-height — viewport height tracker (mobile keyboard)

Recipes

Indigo brand on white

.hw-widget {
  --hw-brand: #4f46e5;
  --hw-on-brand: #ffffff;
}

Brand color that stays consistent in dark mode

By default --hw-brand flips for contrast. If you want your exact brand color in both modes, override it in the dark scope too:

.hw-widget,
.hw-widget[data-theme="dark"] {
  --hw-brand: #7c5cff;
  --hw-on-brand: #ffffff;
}

Match host font

.hw-widget {
  --hw-font: "Inter", -apple-system, sans-serif;
}

Tighter, sharper corners

.hw-widget {
  --hw-radius: 10px;
}

Things to avoid

  • Don't invent token names. var(--hw-surface) or var(--hw-text-muted) won't resolve — they aren't defined. CSS variable fallbacks fail silently, so a typo will look like a dark-mode bug. The complete list is the table above.
  • Don't override hex inside selectors. Prefer overriding the token at the .hw-widget root. That way every selector that reads the token (including future ones) picks up your value.
  • Don't override --hw-primary and --hw-brand to different values. They serve overlapping roles today; pick one as your accent and let the other inherit.

What's not (yet) tokenized

  • Bubble corner radius — uses --hw-radius indirectly but not configurable per-side.
  • Animation timings — currently hard-coded cubic-bezier(0.23, 1, 0.32, 1).
  • Composer attachment chips — share the surface tokens but no dedicated knob yet.