Skip to content

Commit

Permalink
Handle scopes for gradient variables
Browse files Browse the repository at this point in the history
  • Loading branch information
aweell committed Sep 17, 2024
1 parent 77caba9 commit 9f08ca3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tokens/figma/update-middleware.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,19 @@ async function updateBrandCollection(
variableName,
brandMap,
] of variableToBrandMap) {
// Return empty scopes in gradient variables, since they already have a style
let scopes = [VARIABLE_SCOPES.ALL_SCOPES];

const stopRegex = /-stop-\d+$/;

if (stopRegex.test(variableName)) {
scopes = [];
}

const variable = {
name: variableName,
resolvedType: VARIABLE_TYPES.COLOR,
scopes: [VARIABLE_SCOPES.ALL_SCOPES],
scopes: scopes,
targetCollectionName:
COLLECTION_NAMES.SKIN,
};
Expand Down

0 comments on commit 9f08ca3

Please sign in to comment.