Skip to main content
function flattenTokensObject<T>(tokensObject: T, cssVarPrefix?: string): Flattened<T>;
Flattens a nested theme object into a single-level object with CSS variable representations.

Type Parameters

Type Parameter
T extends NestedTokenObject

Parameters

ParameterTypeDefault valueDescription
tokensObjectTundefinedThe nested tokens object to flatten.
cssVarPrefix?string"cdp-web"An optional prefix for the generated CSS variables.

Returns

Flattened<T> A flattened theme object.