Skip to main content
Question

Get variable values for text styles across modes

  • October 19, 2024
  • 2 replies
  • 53 views

Gareth

Hi there, is it possible to retrieve the different values for a variable assigned to a text style property?

Ie. I have a text style with which i have a variable ‘type-scale-1’ assigned to the font size. This variable has several different values based on the mode selected ie. 48 for desktop, 40 for tablet, 32 for mobile etc.

Is it possible to retrieve the variable and its associated values for each mode or does retrieving a text style only ever retrieve the raw value for each text style property for the default mode the file is in?

This topic has been closed for comments

2 replies

tank666
  • 4871 replies
  • October 20, 2024

Just check the valuesByMode property of the variable.


Pavel_Kiselev
  • Power Member
  • 438 replies
  • October 20, 2024

Get a text style, check boundVariables, get a variable, see valuesByMode for details you need


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