Skip to content

CSS Customization 🟑 BETA

What it is. The stylesheet layer of the suite: identity tokens, component styles and a selectable theme. Customisation means changing token values in a local theme, not editing generated pages.

Open it. Read botui/ui/suite/css/identity-tokens.css and the theme files in botui/ui/suite/public/themes/.

Do this. Copy a theme, change only the accent tokens, and verify in light and dark modes.

Limits. No inline styles, CDN links or ad-hoc colours. Neutrals, type, spacing, radii, shadows and motion are fixed by the design system.

Files

Path Role
suite/css/identity-tokens.css Canonical --id-* tokens, light and dark
suite/identity/tokens.css Import shim
suite/public/themes/*.css Selectable themes
suite/css/app.css and component files Suite component styles
suite/identity/fonts.css Local woff2 fonts

CSS Variables (in main.css)

main.css is not a source file in the current tree. The equivalent variables are the --id-* tokens in identity-tokens.css; default.css aliases legacy suite variables (--background, --primary, --win-*, --sentient-*) onto them.

Use var(--id-accent) for the accent, var(--id-ink) for headings, var(--id-text) for body copy, var(--id-line) for borders and var(--id-radius-control) for controls.

Extending the Theme

  1. Add a file in public/themes/.
  2. Keep the legacy aliases from default.css.
  3. Override only --id-accent, --id-accent-hover, --id-accent-text, --id-accent-soft, --id-accent-glow, --id-on-accent.
  4. Check both light and dark values before shipping.

Best Practices

  • Name classes with the gb- prefix used by the suite.
  • Use tokens for every colour, radius and shadow.
  • Use box-shadow: var(--id-focus), never outline: var(--id-focus).
  • Keep local fonts; do not import a remote font.

Component Styling Guide

Message Bubbles

Chat messages use the chat stylesheets under suite/css/. The user bubble uses --id-radius-panel; answers use the body text colour and the fixed conversation column width.

Input Field

Fields use a token background and border. On focus the border becomes the accent; textareas use box-shadow: var(--id-focus) rather than a ring drawn with outline.

Buttons

Class family Appearance
Small settings buttons Bordered, surface background, hover fill
Accent button Accent background, --id-on-accent text
Danger button Danger text and line, danger-soft hover
Icon button Transparent, hover fill

These families are defined in the assistant component stylesheets; reuse them instead of inventing a new button look.

Animation Library

Entrance Animations

Motion tokens define the easing and durations (--id-ease, --id-dur-fast, --id-dur-normal, --id-dur-medium, --id-dur-slow). Named animations are declared in the component stylesheets and all have a reduced-motion block.

Loading States

Streaming chat uses a blinking cursor and a "thinking" pulse. Spinners and progress bars belong to the settings sheets; do not add a new spinner without a reduced-motion rule.

Responsive Design Patterns

Mobile-First Approach

The shell uses measured viewport width, not user-agent sniffing. See Mobile and compact form factors.

Touch-Friendly Styles

Control sizes come from the spacing tokens; keep hit areas at least the size of the existing controls.

Theme Variants

Dark Mode

There is one dark token block: :root[data-color-scheme="dark"]. Do not add a second @media palette. Accent values are derived so accent text still meets contrast.

High Contrast

A high-contrast theme exists in public/themes/. It still uses the token contract; it does not introduce separate component layout rules.

Performance Tips

Keep font files local and limited to the weights used, avoid extra image requests, and put theme values in the head so there is no unstyled first frame.

Browser Compatibility

No separate browser matrix is published for CSS. The suite uses the local libraries shipped with it; do not add a third-party stylesheet to fill a gap.

See Also

Next Step

Read Theme Structure before editing a theme. Styling does not change bot behaviour; see the BASIC scripting chapter.