Skip to content

Commit

Permalink
Merge pull request #4317 from grommet/paddingY-script
Browse files Browse the repository at this point in the history
Fix paddingY:update script for element tokens
  • Loading branch information
taysea authored Oct 31, 2024
2 parents b6a4cb9 + 6383fe5 commit 0b92984
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
7 changes: 7 additions & 0 deletions design-tokens/src/scripts/update-paddingY.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ nonComponentTokens.forEach(category => {
delete updated[category];
});

writeFileSync(
'./tokens/component/element.default.json',
JSON.stringify({ element: updated.element }, null, 2),
);

delete updated.element;

writeFileSync(
'./tokens/component/component.default.json',
JSON.stringify(updated, null, 2),
Expand Down
4 changes: 3 additions & 1 deletion design-tokens/src/scripts/verify-paddingY.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ export const descend = (
const paddingY = (minHeight - lineHeight - 2 * borderWidth) / 2;
if (paddingY !== value.paddingY.$value)
console.error(
`🛑 ${keyPath.join('.')}: ${paddingY} does not match ${
`🛑 ${keyPath.join(
'.',
)}: Expected value ${paddingY} does not match existing value ${
value.paddingY.$value
}. Run paddingY:update if this change is expected.`,
);
Expand Down
4 changes: 2 additions & 2 deletions design-tokens/tokens/component/component.default.json
Original file line number Diff line number Diff line change
Expand Up @@ -3995,7 +3995,7 @@
},
"paddingY": {
"$type": "number",
"$value": 7,
"$value": 8,
"$description": "",
"$extensions": {
"com.figma": {
Expand Down Expand Up @@ -4226,7 +4226,7 @@
},
"paddingY": {
"$type": "number",
"$value": 8,
"$value": 9,
"$description": "",
"$extensions": {
"com.figma": {
Expand Down
2 changes: 1 addition & 1 deletion design-tokens/tokens/component/element.default.json
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@
},
"paddingY": {
"$type": "number",
"$value": 8,
"$value": 9,
"$description": "",
"$extensions": {
"com.figma": {
Expand Down

0 comments on commit 0b92984

Please sign in to comment.