Skip to main content

Enhancing variables to have extra logic in place so that variables can be partially based off other variables


e.g.

Number

new_variable = “{other_number_variable} + 4”


String

new_variable = “{other_text_variable} New Text”


Colour

new_variable = “{other_color_variable}, opacity 4”


Boolean

new_variable = “not {other_boolean_variable}”

Hi there,


Thank you for sharing your idea! We greatly value your feedback, and we would like to gauge the reaction of other members in the community. We may consider it for future enhancements!


Thanks,

Toku


For example, is I have a variable “padding = 32”, allow me to add to the width number: “rpadding] * 2”


This would be great for setting up a flexible design system.


this would make too much sense, 

i work daily with calculations in css so for figma to NOT have this concept is strange to me!

i have variables like space that are dependant on eachother
imagine setting space-m: 20

i want space-s to be space/m / space/scale
etc… 
same goes for font sizes and color-mix


How come this is hasn’t been implemented yet? We really shouldn’t be begging for this functionality.


I’ll even appreciate it more if the extra logic could include some conditionals.

some_color_variable = “if {some_boolean_variable} = TRUE,  #FFFFFF, #A1FFF7”

Basically just take some of the conditional logic / UI that is used for prototype interactions, and apply them on variable values


Reply