From 381cda20fb088b36be7e5748659085c9051a737d Mon Sep 17 00:00:00 2001 From: Neretin Artem Date: Sat, 9 Dec 2023 19:37:12 +0600 Subject: [PATCH] fix(plasma-theme-builder): Add resoterd color methods for generate themes --- website/plasma-theme-builder/src/utils/generate.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/website/plasma-theme-builder/src/utils/generate.ts b/website/plasma-theme-builder/src/utils/generate.ts index 242191a233..a8e534763a 100644 --- a/website/plasma-theme-builder/src/utils/generate.ts +++ b/website/plasma-theme-builder/src/utils/generate.ts @@ -2,6 +2,7 @@ import { ROBO_COMMENT, generateThemes, getThemeTokenDataGroups, + getThemesWithRestoredColors, generateTokenSet, getThemesTokensFallback, } from '@salutejs/plasma-tokens-utils'; @@ -45,7 +46,7 @@ const getSortedExports = (exports: string) => { }; export const getThemesTokenSet = (content: string) => { - const themesTokenDataGroups = getThemeTokenDataGroups(JSON.parse(content)); + const themesTokenDataGroups = getThemesWithRestoredColors(getThemeTokenDataGroups(JSON.parse(content))); return getThemesTokensFallback(themesTokenDataGroups); }; @@ -57,7 +58,7 @@ export const getThemes = async ( ) => { const pathToIndex = getFilesPath().themesIndex; const tokensThemeIndex = await getFilesSource(undefined, owner, repo, pathToIndex, defaultBranch); - const themes = generateThemes(tokensSet, undefined, true); + const themes = generateThemes(tokensSet, undefined, true, true); const [darkTokens, lightTokens, newExports] = themes.map((item) => prettify(item.content));