Help to set an image value in variables?

I need set value for assets in my design system, ex:
My logo dark mode vs light mode, the brand asset are different for the color scheme.

The options available are:

  • Color
  • Number
  • String
  • Boolean

I try insert the URL from image value in string, but I dont have success to retrieve value and set for background.

Anyone have a idea to resolve this? :exploding_head:

Anynone can help me?

1 Like

Just played with something similar. Tried to change the logotype of our multibrand design. In our header component i put both logotypes and controls them with booleans properties. Then I set the boolean values from two booleans variables.

Maybe not the best solutions since it will create more layers in the component?

1 Like

This wasn’t obvious from the UI but I discovered it in the Playground File.

You can bind a string variable to a variant property, which means if you have a component with each image as a variant, you can use a variable to switch between them

1 Like

Tks for help!

I go try this, tnks :wink:

I can’t get this to work. Do you have to name the modes the same as the variants?

For example type=

1 Like

@lucasvieluz I’m probably stating the obvious here, but if you have an svg logo, you can assign color variables to the svg and they will switch in dark mode.

Of course, if you have a png, I feel your pain.

We desperately need a variable for assets, that will switch a graphic asset with modes.

1 Like

Yes… variant are identified by names, and you can think of them as strings.

I think this feature should be coming soon, no?

Running into this issue too i can build a complete complete that isnt bouncing around these things like styles, variables, tokens, & modes