Skip to main content
The Angular UIKit uses a CSS variable-based theming system. There are no theme objects or style input props — all customization is done by overriding CSS variables in your global stylesheet.

How It Works

All design tokens are defined as CSS custom properties on :root in the UIKit’s css-variables.css. You override them in your own global CSS file to apply your brand.

Light / Dark Mode

Dark mode is activated by setting the data-theme="dark" attribute on the <html> element:
You can also call setTheme or toggleTheme directly:

Matching the system theme

ThemeService follows the operating system automatically. You do not need a matchMedia recipe of your own: the service reads prefers-color-scheme in its constructor via initFromPreference(), and registers a change listener so the UI keeps following the OS while the app is open. It writes data-theme through Angular’s DOCUMENT token, so it is SSR-safe.
A manual choice is not sticky — know this before you build a theme toggle.Two behaviours surprise people, and both are current as of @cometchat/chat-uikit-angular@5.1.0:
  1. The OS listener overrides a manual choice. Calling setTheme('dark') applies immediately, but the next time the OS switches (for example at sunset) the listener applies the OS theme and discards the user’s selection.
  2. Nothing is persisted. setTheme() and toggleTheme() do not write to localStorage, so any manual choice is gone after a reload and the app returns to the OS theme.
If your product needs a sticky preference, own it in your own app: persist the choice, and re-apply it after the service initialises.
SSR Note: Always use Angular’s DOCUMENT injection token instead of document directly.

Customizing Colors

Override variables in your global stylesheet (styles.css or styles.scss):

Typography

Available font scale variables:

Spacing & Border Radius

Component-Level Scoping

To override styles for a specific instance, scope the variable override to that element’s selector:

Shadows & Overlays

Avatars & Badges

Status Indicators

Complete Custom Theme Example

Sound Manager

CometChatSoundManager manages audio cues for incoming/outgoing calls and messages. Sound is a frozen object on CometChatSoundManager — access event keys via CometChatSoundManager.Sound.

Sound Events

Methods

Usage


Design Token Pipelines

If your team uses a design token pipeline (e.g. Style Dictionary, Theo), you can generate the CSS variable overrides as a build artifact and import the output file in styles.css. The UIKit’s variable names follow a consistent --cometchat-{category}-{scale} pattern that maps cleanly to token schemas.

Color Palette

The primary color defines key actions, branding, and UI elements, while the extended primary palette provides variations for supporting components.

Primary Color

Light Mode

Dark Mode

Extended Primary Colors

Light Mode

Dark Mode


Full Variable Reference

Colors

Semantic Aliases