r/FigmaDesign • u/Mysterious_Face126 • 3d ago
help Switching fonts using toggle switches and variables
How to make this toggle switch properly switch between "Normal font" and "Dyslexic font" using a custom toggle switch.
On my switch on the "off" variant its set to target "Normal font" and set it to "Dyslexic font" which works perfectly. But am not sure how I could make it do the opposite on "On" variant.
Thank You
4
Upvotes


1
u/4shl3y 2d ago
I’ve just tried it myself, not sure if I’m good at explaining it but this is how I did it.
Three variables, string: regular-font; dyslexic-font; current-font
Set value of current-font to regular-font
(Current-font is used in the text style)
Button: on click; action conditional
If current-font == regular-font
Set current-font to dyslexic-font
Else set current-font to regular-font
I think your main issue is that you didn’t use a conditional