Skip to main content

Typography variables - Bind a variable to a specific text style

  • October 21, 2024
  • 2 replies
  • 57 views

gimaf
  • New Participant
  • 9 replies

Use case
I have a button component which for different colors we use different text styles (one is bold the other is regular).

Solution
It would be great if I could just add to the button variables table a String field where I say which style to use based on the mode and bind that String to the text style of the label.

2 replies

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

Make a text label component, give it few variants. Place that text label component inside the button and bound style variable to the text label instance. In theory this should do the trick for you


gimaf
  • Author
  • New Participant
  • 9 replies
  • October 21, 2024

I thought about that, but it would be better in my opinion if we could use variables instead: less headaches, less components, more consistency overall 🙂
in the mean time, the trick you suggested seems to work, thank you!


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