diff --git a/scripts/buildFigma.ts b/scripts/buildFigma.ts index 6ad80b5bc..09261131a 100644 --- a/scripts/buildFigma.ts +++ b/scripts/buildFigma.ts @@ -61,14 +61,14 @@ const buildFigma = async (buildOptions: ConfigGeneratorOptions): Promise = await extended.buildAllPlatforms() } // - for (const {filename, source, include} of themes) { + for (const {filename, source, include, theme} of themes) { // build functional scales const extended = await PrimerStyleDictionary.extend({ source, include, platforms: { figma: figma(`figma/themes/${filename}.json`, buildOptions.prefix, buildOptions.buildPath, { - theme: filename.replaceAll('-', ' '), + theme: [theme, getFallbackTheme(theme)], }), }, }) diff --git a/src/platforms/figma.ts b/src/platforms/figma.ts index 5164eb7f9..0e0f1a30c 100644 --- a/src/platforms/figma.ts +++ b/src/platforms/figma.ts @@ -45,6 +45,7 @@ export const figma: PlatformInitializer = (outputFile, prefix, buildPath, option }, // should this object be spread here? ...options, + theme: options?.theme[0].replaceAll('-', ' '), themeOverrides: { theme: options?.theme, }, @@ -58,7 +59,7 @@ export const figma: PlatformInitializer = (outputFile, prefix, buildPath, option format: `json/figma`, options: { outputReferences: true, - theme: options?.theme, + theme: options?.theme[0].replaceAll('-', ' '), }, }, ],