StaticsetOverrides one or more global default token values. Useful when you want to adjust the baseline without creating a named theme. The changes apply to all themes and persist until resetDefaults() is called. Note that existing themes are not affected; they will continue to inherit the old defaults until re-applied.
Partial token set with new default values.
StaticresetResets defaults to the original built-in values.
StaticregisterRegisters a named theme. Themes are partial; unspecified tokens fall back to the current defaults when resolved.
Unique name for the theme.
Partial token set defining the theme. Only tokens that differ from the defaults need to be included.
StaticunregisterUnregisters a named theme.
The name of the theme to unregister.
StaticgetRetrieves a registered theme by name.
The name of the theme to retrieve.
The theme object if found, otherwise undefined.
StatichasChecks if a theme with the given name is registered.
The name of the theme to check.
True if the theme is registered, otherwise false.
StaticgetReturns a list of all registered theme names.
An array of registered theme names.
StaticresolveResolves a final token map by merging in order: current defaults → named theme (if any) → optional inline overrides. Returns a plain object; nothing is applied to the DOM.
Optionaltheme: string | DiagramThemeA registered theme name or an inline theme object.
Optionaloverrides: DiagramThemeOptional inline token overrides applied on top of the resolved theme.
The final resolved theme object.
StaticapplyApplies a theme to an element as CSS custom properties. The vars are scoped to that element and inherited by all children, so any editor component rendered inside it consumes the theme automatically.
The element to receive the CSS custom properties.
Optionaltheme: string | DiagramThemeA registered theme name, an inline DiagramTheme object, or omit to apply the current defaults only.
Optionaloverrides: DiagramThemeExtra token overrides applied on top of the resolved theme.
StaticunapplyRemoves all CSS custom properties that were set by this registry on the element. Properties belonging to other systems are not touched.
The element to clean up.
A static registry for diagram editor UI themes.
Themes are partial DiagramTheme token sets. When applied to an element they are set as CSS custom properties and inherited by all children — so any editor component rendered inside that element picks up the theme automatically, whether inside a full DiagramEditor or a hand-wired custom layout.
Precedence (lowest → highest):