Skip to main content

Allow variables to be partially based off other variables

  • February 12, 2024
  • 6 replies
  • 329 views

Sophie26

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}”

6 replies

y_toku
Figmate
  • Community Support
  • 2545 replies
  • February 13, 2024

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


Matthew_Hall

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


Albert4
  • 1 reply
  • November 28, 2024

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


Odinn Hullekes

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


Alex Obreja
  • New Member
  • 3 replies
  • February 28, 2025

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


rksilvergreen

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings