-
-
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 variable creation issue #3124
Conversation
🦋 Changeset detectedLatest commit: b538dc5 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:c64bfb16c45192973694d102cf2e6d1ce303d2be Test coverage results 🧪
|
Commit SHA:c64bfb16c45192973694d102cf2e6d1ce303d2be |
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
This pull request solves 2 issues:
Font weight issues
When users were using numerical font weights in their typography tokens, and they had a varaible reference to both the family and the numerical weight, we didnt properly create styles. This only occurred if the font family and weight wasnt covered by our font weight fallbacks (e.g. use
Comic Sans MS
with a weight of600
)This is due to Figma requiring us to
loadFontAsync
using the string version of the weight ("Bold"). However, all we know is the numerical weight ("600"). We can not realistically know the string version. So this PR changes this to rather load all font weights of the current font family.Color token issues with modifiers when creating color styles
If users were using a color token that had a pure reference such as
{colors.gray.500}
and a modifier, and the colors.gray.500 token existed as a variable, previously we would use a variable reference. We now check if the token is using a modifier, and if yes, we do not go an create a variable reference.This issue ONLY occurred if the Variable exists as a reference and the user is trying to create color styles using those variable reference
CleanShot.2024-09-06.at.09.22.39.mp4
https://github.com/user-attachments/assets/66ef0c75-e144-4113-9c47-66c8186e6b91
example.json