From a4c0e104ec9271b1c123b49548ddbc2ef1d9a82f Mon Sep 17 00:00:00 2001 From: Sarah Rambacher Date: Wed, 5 Jun 2024 10:15:54 -0400 Subject: [PATCH 1/2] feat(exporter): don't export figma-only variables --- packages/module/plugins/export-patternfly-tokens/code.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/module/plugins/export-patternfly-tokens/code.js b/packages/module/plugins/export-patternfly-tokens/code.js index f7ebd34..9d77662 100644 --- a/packages/module/plugins/export-patternfly-tokens/code.js +++ b/packages/module/plugins/export-patternfly-tokens/code.js @@ -45,6 +45,11 @@ function processCollection({ name, modes, variableIds }) { variableIds.forEach((variableId) => { const { name, resolvedType, valuesByMode } = figma.variables.getVariableById(variableId); + + if (name.includes("figma-only")) { + return; // Skip this variable + } + const value = valuesByMode[mode.modeId]; if (value !== undefined && ["COLOR", "FLOAT", "STRING"].includes(resolvedType)) { From 76594f31e06c1cb799db961486368cde4f7ec37b Mon Sep 17 00:00:00 2001 From: Sarah Rambacher Date: Wed, 5 Jun 2024 14:07:03 -0400 Subject: [PATCH 2/2] feat(exporter): add px only to font-size --- packages/module/build.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/module/build.js b/packages/module/build.js index bf2dd93..3f8bfb4 100644 --- a/packages/module/build.js +++ b/packages/module/build.js @@ -31,7 +31,7 @@ const build = (selector) => { token.attributes.type === 'icon' || token.attributes.type === 'breakpoint' || (token.attributes.type === 'box-shadow' && token.attributes.item !== 'color') || - token.attributes.type === 'font', + (token.attributes.type === 'font' && token.attributes.item === 'size'), transformer: (token) => `${token.value}px` });