Skip to content

Commit

Permalink
Merge pull request #65 from srambach/do-not-export-figma-only
Browse files Browse the repository at this point in the history
feat(exporter): don't export figma-only variables
  • Loading branch information
mcoker authored Jun 6, 2024
2 parents bb41eba + 76594f3 commit 1d475ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/module/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`
});

Expand Down
5 changes: 5 additions & 0 deletions packages/module/plugins/export-patternfly-tokens/code.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 1d475ce

Please sign in to comment.