-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
2774 spike gradients driven by variables #2884
Conversation
|
…thub.com/tokens-studio/figma-plugin into 2774-spike-gradients-driven-by-variables
@@ -5,6 +5,16 @@ import { defaultTokenValueRetriever } from './TokenValueRetriever'; | |||
import { ColorPaintType, tryApplyColorVariableId } from '@/utils/tryApplyColorVariableId'; | |||
import { unbindVariableFromTarget } from './unbindVariableFromTarget'; | |||
|
|||
const getReferenceTokensFromGradient = (rawValue: string): string[] => { |
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 extract this into its own file and write a test? this should be able to properly extract values like
linear-gradient(90deg, {accent.bg} 0%, {accent.default} 100%) = [accent.bg, accent.default]
linear-gradient(90deg, {accent.bg} 0%, {accent.default} 50%, #ff0000 100%) = [accent.bg, accent.default]
linear-gradient({accent.bg} 0%, {accent.default} 100%) = [accent.bg, accent.default]
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.
…plugin into 2774-spike-gradients-driven-by-variables
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.
🎉
Why does this PR exist?
Current plugin can not assign color variables to gradient's color stops due to previous figma plugin does not support it.
Closes #2774
What does this pull request do?
Updated figma plugin has
boundVariables
field withcolor
field to support color variable assigning to gradient's color stops.Updated
gradientStops
with color variables Ids in it.Testing this change
Additional Notes (if any)
20240619_104106.mp4