Skip to content

Theme Structure 🟑 BETA

What it is. The layering that paints every suite surface: canonical --id-* tokens, a selectable theme stylesheet, and local fonts. The default theme adds no palette of its own.

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

Do this. Pick a theme in Settings; to change it, copy a theme file into public/themes/ and edit token values only.

Limits. Other themes may vary only the accent colour. Neutrals, type scale, spacing, radii, shadows and motion are fixed by the design system.

Design Principles

Principle Where it is written
Tokens are the single source suite/css/identity-tokens.css
Themes may change only the accent DESIGN-SYSTEM.md
No flash on first frame Theme and text size applied in <head>
Offline assets Local woff2 fonts, inline icons, no CDN

Creating Your Theme

  1. Copy default.css to a new file in public/themes/.
  2. Keep the legacy-variable aliases; change only --id-accent* values.
  3. Reload the shell and select the theme.

Theme Loading Process

  1. theme.js and textsize.js run in the document head before paint.
  2. The selected stylesheet is applied from public/themes/.
  3. accent.js derives the accent family and writes it to the document root.
  4. Light and dark values come from the single :root[data-color-scheme="dark"] block in the token file.

File Organization Best Practices

CSS File Options

Path Role
suite/css/identity-tokens.css Canonical light and dark --id-* values
suite/identity/tokens.css Three-line shim importing the canonical file
suite/public/themes/*.css Selectable themes
suite/css/*.css Component stylesheets using var(--id-…)

Asset Management

Fonts are local woff2 files under suite/identity/fonts/. Icons and logos are inline. Never reference an external font, sprite or stylesheet.

Creating a Custom Theme

Step 1: Create Theme Folder

There is no theme folder to create: themes are individual files in botui/ui/suite/public/themes/. Add your file there.

Step 2: Create Your CSS

Start from default.css. It aliases legacy suite variables onto the tokens rather than defining a parallel palette.

Step 3: Style Components

Use tokens such as --id-surface-solid, --id-ink, --id-line and --id-radius-control. Use box-shadow: var(--id-focus); --id-focus is a shadow, not an outline colour.

Using the Theme

Select it in Settings β€Ί Appearance. Theme choice is stored locally and applied before the first paint on the next load.

Performance Optimization

CSS Loading Strategy

Load the theme in the head together with the token shim, so the first frame uses the chosen values.

Asset Optimization

Keep only local fonts that are used, and reuse inline icons instead of new image requests.

Theme Selection

Light, dark and system modes are supported. The system mode follows the OS setting live; the accent is independent of the mode.

Accessibility Considerations

Accent text is derived to at least 4.5:1 contrast. Keep the existing focus ring and text-scale behaviour; do not fix sizes in pixels where the type-scale tokens exist.

Advanced Personalization Options

Beyond CSS Theming

A change to copy, workflow or behaviour is not a theme. Put it in the app's markup and JavaScript with catalogue keys, not in a stylesheet.

Join the Community

Corrections to documentation go through the repository's issue and pull-request flow; see the contribution chapter.

Using General Bots as a Foundation

Keep the design system intact when embedding: local fonts, token colours, no CDN.

Getting Started with UI Development

Read CSS Customization next, then the app markup under botui/ui/suite/<app>/.

See Also

Next Step

Open CSS Customization for component-level examples. A BASIC change does not alter the theme; see the BASIC scripting chapter.