Skip to main content

Function: fromDtcg()

function fromDtcg(tokens, opts?): RasdTheme;

Defined in: dtcg.ts:137

Reads a DTCG token document back into a RasdTheme.

Only the leaves Rasd knows are imported; unknown groups are ignored (a DTCG file from Figma carries far more than a theme needs). Throws RASD_THEME_INVALID when no id can be determined, since a theme without an identity cannot be registered, cached or extended.

Parameters

ParameterType
tokensDtcgDocument
optsFromDtcgOptions

Returns

RasdTheme