-
-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix typography tokens resolution #3157
Conversation
🦋 Changeset detectedLatest commit: b946902 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Commit SHA:c279d076dd37af344d438226f4b8768277ff5e34 Test coverage results 🧪
|
expect(setTextValuesOnTargetSpy).not.toHaveBeenCalled(); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This update in condition is in line with the updated logic, wherein, when a text node has both individual typography value tokens and a typography token, it will not call setTextValuesOnTarget directly, instead will route to tryApplyTypographyCompositeVariable.
|
||
// Apply typography token directly if no other properties exist | ||
if (data.typography && resolvedToken && isSingleTypographyValue(resolvedToken.value) && !Object.keys(values).length) { | ||
setTextValuesOnTarget(node, data.typography, baseFontSize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now we will call this setTextValuesOnTarget here when a text Node has only a typography token applied to it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Addresses #3118
Description
Fixes a bug occurring when a user applies a typography token on a text node, and then applies another token, tinkering with an individual typography property(like font size or font family, etc.), and the user clicks on 'Apply to selection', the typography token overrides the individual token property, which is not expected behaviour.
Type of change
How to test this
Screenshots or video (if necessary):