Skip to Content
ReferenceShared typesColor variants

Color variants

Audience: CMS editors, integrators, and developers.

ColorVariant contains one complete color configuration. A Theme selects it through lightColorVariant or darkColorVariant. The same record can serve both appearances.

Record fields

id●
string
required

CMS record identifier.

name●
string
required

Required display name. It does not select the appearance or a surface role.

userId●
string
required

CMS owner identifier, set during creation and preserved during updates. It is not part of the public ColorVariant payload.

Surfaces and actions

surfaces●required

CMS relation to the surfaces available in this variant. One surface with the theme-page Tag is required. Each Tag can occur only once in this relation.

actionStyle●required

Complete shared style for filled actions. A surface can select a complete override.

theme-brand, theme-panel, and custom surface keys are optional. Surface selection uses the first available key in the component’s requested order. If none is available, it uses this variant’s theme-page surface. The selection runs independently for each appearance.

The CMS stores surfaces as a relationship list. The public CMS.ColorVariant contains a map keyed by each related Tag’s exact name:

type ThemeSurfaces = { 'theme-page': ThemeSurface; [key: string]: ThemeSurface; };

The display name of a ThemeSurface does not determine its map key.

Status colors

All six CMS fields are required strings. Supply explicit background and text colors for each status.

CMS fieldPublic propertyMeaning
errorBackgroundstatus.error.backgroundError background.
errorTextstatus.error.textText on the error background.
successBackgroundstatus.success.backgroundSuccess background.
successTextstatus.success.textText on the success background.
warningBackgroundstatus.warning.backgroundWarning background.
warningTextstatus.warning.textText on the warning background.

These pairs are separate from ordinary surface and action colors.

Color values and constraints

Color fields use the CMS color input. Enter a valid CSS color such as #1c69d4 or oklch(60% 0.15 250). Values are stored as strings without a format conversion. The preview uses the browser’s CSS color support.

A variant must keep its required Page surface and shared ActionStyle. The CMS rejects duplicate surface Tags and removal of the required Page role. A ColorVariant cannot be deleted while a Theme references it.

Editors must supply suitable contrast. The application does not infer text colors from brightness or correct unsuitable pairs.

Last updated on