Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix style variable decimal import #3241

Merged
merged 13 commits into from
Jan 9, 2025
Prev Previous commit
Next Next commit
set default baseRem size to 16 if ui setting base Rem is empty
akshay-gupta7 committed Jan 7, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit cd7628aa8f57e104557b6dfdf19e68a467e189a4
9 changes: 5 additions & 4 deletions packages/tokens-studio-for-figma/src/plugin/pullVariables.ts
Original file line number Diff line number Diff line change
@@ -16,10 +16,11 @@ export default async function pullVariables(options: PullVariablesOptions): Prom

let baseRem = 16;
if (options.useRem) {
baseRem = await figma.clientStorage.getAsync('uiSettings').then(async (uiSettings) => {
const settings = JSON.parse(await uiSettings);
return settings.baseFontSize;
});
const uiSettings = await figma.clientStorage.getAsync('uiSettings');
const settings = JSON.parse(await uiSettings);
baseRem = settings?.baseFontSize && !isNaN(settings.baseFontSize)
? Number(settings.baseFontSize)
: 16;
}

const localVariables = await getVariablesWithoutZombies();