Skip to content

Commit

Permalink
Add text-content scope
Browse files Browse the repository at this point in the history
  • Loading branch information
aweell committed Sep 24, 2024
1 parent b9048e3 commit aa13b41
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions tokens/figma/utils/constants.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const VARIABLE_SCOPES = {
FONT_SIZE: "FONT_SIZE",
LINE_HEIGHT: "LINE_HEIGHT",
FONT_FAMILY: "FONT_FAMILY",
TEXT_CONTENT: "TEXT_CONTENT",
};

export const BRANDS = {
Expand Down
21 changes: 17 additions & 4 deletions tokens/figma/variables.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -77,28 +77,38 @@ export const getNonColorVariables = (
resolvedType: VARIABLE_TYPES.FLOAT,
variableScopes: [
VARIABLE_SCOPES.CORNER_RADIUS,
VARIABLE_SCOPES.TEXT_CONTENT,
],
hasAlias: false,
},
{
variables: jsonData[brand]?.fontWeight || [],
collectionName: COLLECTION_NAMES.SKIN,
resolvedType: VARIABLE_TYPES.STRING,
variableScopes: [VARIABLE_SCOPES.FONT_WEIGHT],
variableScopes: [
VARIABLE_SCOPES.FONT_WEIGHT,
VARIABLE_SCOPES.TEXT_CONTENT,
],
hasAlias: false,
},
{
variables: jsonData[brand]?.fontSize || [],
collectionName: COLLECTION_NAMES.SKIN,
resolvedType: VARIABLE_TYPES.FLOAT,
variableScopes: [VARIABLE_SCOPES.FONT_SIZE],
variableScopes: [
VARIABLE_SCOPES.FONT_SIZE,
VARIABLE_SCOPES.TEXT_CONTENT,
],
hasAlias: false,
},
{
variables: jsonData[brand]?.lineHeight || [],
collectionName: COLLECTION_NAMES.SKIN,
resolvedType: VARIABLE_TYPES.FLOAT,
variableScopes: [VARIABLE_SCOPES.LINE_HEIGHT],
variableScopes: [
VARIABLE_SCOPES.LINE_HEIGHT,
VARIABLE_SCOPES.TEXT_CONTENT,
],
hasAlias: false,
},
{
Expand All @@ -118,7 +128,10 @@ export const getNonColorVariables = (
],
collectionName: COLLECTION_NAMES.SKIN,
resolvedType: VARIABLE_TYPES.STRING,
variableScopes: [VARIABLE_SCOPES.FONT_FAMILY],
variableScopes: [
VARIABLE_SCOPES.FONT_FAMILY,
VARIABLE_SCOPES.TEXT_CONTENT,
],
hasAlias: false,
},
{
Expand Down

0 comments on commit aa13b41

Please sign in to comment.