-
-
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
1671 base font size token doesnt pick up tokens #1672
Conversation
Commit SHA:360f6121550b1e59563746ccbb1e5ef39df88f2a Test coverage results 🧪
|
…ps://github.com/six7/figma-tokens into 1671-base-font-size-token-doesnt-pick-up-tokens
src/plugin/node.ts
Outdated
|
||
let nameToLookFor = ''; | ||
if (aliasBaseFontSize) { | ||
if (aliasBaseFontSize.startsWith('{')) { |
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.
shouldnt we already have the value of aliasBaseFontSize
in settings? you query on line 197 of Tokens.tsx the aliasValue? That should be the real value to be used, right? No need to further query the alias value of it'd already be in store?
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.
shouldnt we already have the value of
aliasBaseFontSize
in settings? you query on line 197 of Tokens.tsx the aliasValue? That should be the real value to be used, right? No need to further query the alias value of it'd already be in store?
@six7 Yes. We store the real value to be used. But when we switch the theme, it causes the document update. But at this time, the real value has not been updated yet. It will be updated after this process. That's why I resolved the aliasValue here.
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.
Then dont we have a function to getAliasVallue? I feel we shouldnt have alias resolve logic in node.ts - we should import a function that does it.
Or even better, make sure that by the time the document updates the base font size token has been updated
…ps://github.com/six7/figma-tokens into 1671-base-font-size-token-doesnt-pick-up-tokens
src/app/store/models/settings.tsx
Outdated
@@ -196,6 +196,7 @@ export const settings = createModel<RootModel>()({ | |||
}, | |||
setBaseFontSize: (payload, rootState) => { | |||
setUI(rootState.settings); | |||
dispatch.tokenState.updateDocument({ shouldUpdateNodes: true }); |
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.
can you set this to shouldUpdateNodes: false
?
We wouldnt want a change in the base font size trigger a document wide update, which could mean the users would have to wait a long time. So instead lets just update the document, but not the nodes.
20230308_213841.mp4